I have problem when using currentrowchanging event,
when first load the grid, when I change the row,, the event fire correctly, this is my event,
buf after sorting or grouping it appear not correct.....
this is the condition
1. when I click the row in index 4 (ID = ROM and name = ROMA VATIKAN), buf after sorting the column country name, when I click the index 4 (ID = ALS and name = ALASKA), the value is still (ID = ROM and name = ROMA VATIKAN) not (ID = ALS and name = ALASKA)... how to get value ID = "ALS" in index for,, look for the attachment image (grid after order by.png)
2. when I click the row in index 1 (ID = BGR and name = BOGOR), buf after grouping the column country name, when I click the value (ID = ROM and name = ROMA VATIKAN), the value is still (ID = BGR and name = BOGOR) not (ID = ROM and name = ROM VATIKAN) cause it refer into index = 1... how to get value ID = "ROM" in index for,, look for the attachment image (grid after grouping.png)
this is my currenrowchanging event
void gridData_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e)
{
if (gridData.RowCount != 0)
{
int rowindex = 0;
if (e.NewRow == null)
{
ClearData();
return;
}
rowindex = e.NewRow.Index;
//}
txtID.Text = gridData.Rows[rowindex].Cells["ID"].Value.ToString();
txtName.Text = gridData.Rows[rowindex].Cells["Name"].Value.ToString();
cmbCountryID.Text = gridData.Rows[rowindex].Cells["CountryID"].Value.ToString();
cmbCountryName.Text = gridData.Rows[rowindex].Cells["CountryName"].Value.ToString();
if (gridData.Rows[rowindex].Cells["ActiveStatus"].Value.ToString() == "1")
{
rbYes.IsChecked = true;
}
else
{
rbNo.IsChecked = true;
}
}
}