This question is locked. New answers and comments are not allowed.
Hello.
I have a question about rowloaded event.
I generate column of gridview by code as follow:
but in RowLoaded event , if j>18,it will error, i runing it step by step the e.Row.cells.count is 18. why?
Thanks in advance!
I have a question about rowloaded event.
I generate column of gridview by code as follow:
void GenerateGridView() { for (int i=0;i<30;i++) { GridViewDataColumn column = new GridViewDataColumn(); column.Header = i.ToString(); column.IsReadOnly = true; this.gridview1.Columns.Add(column); } this.gridview1.ItemSource = list;//my data } private void gridview1_RowLoaded(object sender, RowLoadedEventArgs e) { if (e.Row is GridViewHeaderRow) return; for(int j=0;j<30;j++) e.Row.Cells[j].Content = j.ToString() }but in RowLoaded event , if j>18,it will error, i runing it step by step the e.Row.cells.count is 18. why?
Thanks in advance!