DataGrid
-
Hi all I am working with datagrid of 2005.I have 10 rows in it.It has three columns. Id,Name,ParentId Now my scenario is that if first records id is the parent id for all other 9 records, i need to select entire rows.for that i was using grid.select property but its not working,means its not getting selected i am giving the partial code..can anyone give me what is gng wrong in this code Advnaced thanks for (int tmpCnt = 0; tmpCnt < AuthorisedTable.Rows.Count; tmpCnt++) { //if (dataGridAuthorised.IsSelected(tmpCnt) )// if (AuthorisedTable.Rows[tmpCnt]["Type"].ToString()=="Meeting") { string tmpOtherID = (AuthorisedTable.Rows[tmpCnt]["EventId"].ToString()); for (int tmpRace = 0; tmpRace < AuthorisedTable.Rows.Count; tmpRace++) { if (AuthorisedTable.Rows[tmpRace]["OtherID"].ToString() == tmpOtherID) { this.dataGridAuthorised.Select(tmpRace); } } } }
Regards DilipRam
-
Hi all I am working with datagrid of 2005.I have 10 rows in it.It has three columns. Id,Name,ParentId Now my scenario is that if first records id is the parent id for all other 9 records, i need to select entire rows.for that i was using grid.select property but its not working,means its not getting selected i am giving the partial code..can anyone give me what is gng wrong in this code Advnaced thanks for (int tmpCnt = 0; tmpCnt < AuthorisedTable.Rows.Count; tmpCnt++) { //if (dataGridAuthorised.IsSelected(tmpCnt) )// if (AuthorisedTable.Rows[tmpCnt]["Type"].ToString()=="Meeting") { string tmpOtherID = (AuthorisedTable.Rows[tmpCnt]["EventId"].ToString()); for (int tmpRace = 0; tmpRace < AuthorisedTable.Rows.Count; tmpRace++) { if (AuthorisedTable.Rows[tmpRace]["OtherID"].ToString() == tmpOtherID) { this.dataGridAuthorised.Select(tmpRace); } } } }
Regards DilipRam
Try to replace the
this.dataGridAuthorised.Select(tmpRace);
tothis.dataGridAuthorised.Rows[tmpRace].Selected=true;
And check the selection mode property.Visit my blog at http://dotnetforeveryone.blogspot.com/
-
Try to replace the
this.dataGridAuthorised.Select(tmpRace);
tothis.dataGridAuthorised.Rows[tmpRace].Selected=true;
And check the selection mode property.Visit my blog at http://dotnetforeveryone.blogspot.com/