Click here to Skip to main content
15,894,630 members
Home / Discussions / C#
   

C#

 
GeneralRe: what happens if value is longer than fieldlength Pin
stephan_0075-May-08 3:00
stephan_0075-May-08 3:00 
GeneralRe: what happens if value is longer than fieldlength [modified] Pin
stephan_0075-May-08 3:03
stephan_0075-May-08 3:03 
AnswerRe: what happens if value is longer than fieldlength Pin
SomeGuyThatIsMe5-May-08 2:57
SomeGuyThatIsMe5-May-08 2:57 
GeneralRe: what happens if value is longer than fieldlength Pin
stephan_0075-May-08 3:16
stephan_0075-May-08 3:16 
GeneralRe: what happens if value is longer than fieldlength Pin
SomeGuyThatIsMe5-May-08 3:31
SomeGuyThatIsMe5-May-08 3:31 
QuestionUsing "DictationGrammar" to dictate a URL Pin
thoraia5-May-08 2:37
thoraia5-May-08 2:37 
QuestionDynamic workflow Project Pin
Thaer Hamael5-May-08 2:00
Thaer Hamael5-May-08 2:00 
AnswerCP Members: question already asked Pin
leckey5-May-08 17:40
leckey5-May-08 17:40 
QuestionLayout takes time to rearrange after rezise, how to fix? Pin
leeoze5-May-08 1:59
leeoze5-May-08 1:59 
AnswerRe: Layout takes time to rearrange after rezise, how to fix? Pin
Anthony Mushrow5-May-08 2:13
professionalAnthony Mushrow5-May-08 2:13 
QuestionHyperlinks to access outlook items Pin
asasov5-May-08 1:49
asasov5-May-08 1:49 
AnswerRe: Hyperlinks to access outlook items Pin
Anthony Mushrow5-May-08 2:19
professionalAnthony Mushrow5-May-08 2:19 
GeneralRe: Hyperlinks to access outlook items Pin
asasov5-May-08 2:31
asasov5-May-08 2:31 
GeneralRe: Hyperlinks to access outlook items Pin
Anthony Mushrow5-May-08 2:37
professionalAnthony Mushrow5-May-08 2:37 
GeneralRe: Hyperlinks to access outlook items Pin
asasov5-May-08 2:40
asasov5-May-08 2:40 
QuestionAsynCallback Pin
AlexPizzano5-May-08 1:28
AlexPizzano5-May-08 1:28 
QuestionHow to access the rights and authorised users of a shared folder (in C# web based application)? Pin
Deepali Dhingra5-May-08 0:48
professionalDeepali Dhingra5-May-08 0:48 
AnswerRe: How to access the rights and authorised users of a shared folder (in C# web based application)? Pin
Peter Josefsson Sweden5-May-08 3:01
Peter Josefsson Sweden5-May-08 3:01 
GeneralRe: How to access the rights and authorised users of a shared folder (in C# web based application)? Pin
Deepali Dhingra6-May-08 19:27
professionalDeepali Dhingra6-May-08 19:27 
GeneralRe: How to access the rights and authorised users of a shared folder (in C# web based application)? Pin
Peter Josefsson Sweden6-May-08 22:04
Peter Josefsson Sweden6-May-08 22:04 
QuestionWhile editing a cell that is newly created in GridView throws Index out of range error Pin
vytheese4-May-08 23:19
professionalvytheese4-May-08 23:19 
<br />
namespace WindowsFormsApplication1<br />
{<br />
    public partial class Form1 : Form<br />
    {<br />
        private List<Data> dataList = new List<Data>();<br />
        public Form1()<br />
        {<br />
            InitializeComponent();<br />
           // FillData();<br />
            dataGridView1.DataSource = dataList;<br />
        }<br />
<br />
        private void addTToolStripMenuItem_Click(object sender, EventArgs e)<br />
        {<br />
            dataList.Add(new Data() { Name = "V", LastName = "J" });<br />
            dataGridView1.DataSource = null;<br />
            dataGridView1.DataSource = dataList;            <br />
        }<br />
<br />
        private void FillData()<br />
        {<br />
            dataList.Add(new Data() { Name = "V", LastName = "J" });<br />
            dataList.Add(new Data() { Name = "A", LastName = "B" });<br />
            dataList.Add(new Data() { Name = "C", LastName = "D" });<br />
        }<br />
    }<br />
<br />
    public class Data<br />
    {<br />
        public string Name { get; set; }<br />
        public string LastName { get; set; }<br />
    }<br />
}<br />


In the above code I try to add a data in the List through gridview by using context menu.
Its working fine if already List is populated by data.

But fails if I try to add a data without the List is populated.
Scenario on fail:
screen 1: Form with empty gridview is shown.

screen 2: I right click the gridview which show the context menu "Add", when I clicks addTToolStripMenuItem_Click method is called. which creates the data and adds in the list.

screen 3: The gridview with the one data is appearing.

scrren 4: When I tried to click on the cell ( i.e, newly created ). The error is getting thrown "IndexOutOfRange" -1.

Is I am missing any propeties to set.

Thanks in advance

Regards,
Vythees

Miles to go before sleep...

AnswerRe: While editing a cell that is newly created in GridView throws Index out of range error Pin
Luc Pattyn4-May-08 23:33
sitebuilderLuc Pattyn4-May-08 23:33 
GeneralRe: While editing a cell that is newly created in GridView throws Index out of range error Pin
vytheese5-May-08 0:13
professionalvytheese5-May-08 0:13 
QuestionProblem with Modal Form Pin
MehmetFurkan4-May-08 22:21
MehmetFurkan4-May-08 22:21 
AnswerRe: Problem with Modal Form Pin
Anindya Chatterjee4-May-08 22:39
Anindya Chatterjee4-May-08 22:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.