I would like to enable/disable button's on my form based on whether the user clicks the master row or the child row.
I am trying the following code, but this does not seem to work correctly in all the conditions.
What is the correct way to do this?
-------------------
GridViewSelectedRowsCollection selectedRows = this.rgResults.SelectedRows;
foreach (GridViewRowInfo selectedRow in selectedRows)
{
GridViewDataRowInfo selectedDataRow = selectedRow as GridViewDataRowInfo;
if (selectedDataRow != null)
{
bool isMaster = (selectedDataRow.ViewTemplate.ChildGridViewTemplates.Count == 1);
if (isMaster)
{
//Enable button1
//Disable button2
}
else
{
//Enable button2
//Disable button1
}
I am trying the following code, but this does not seem to work correctly in all the conditions.
What is the correct way to do this?
-------------------
GridViewSelectedRowsCollection selectedRows = this.rgResults.SelectedRows;
foreach (GridViewRowInfo selectedRow in selectedRows)
{
GridViewDataRowInfo selectedDataRow = selectedRow as GridViewDataRowInfo;
if (selectedDataRow != null)
{
bool isMaster = (selectedDataRow.ViewTemplate.ChildGridViewTemplates.Count == 1);
if (isMaster)
{
//Enable button1
//Disable button2
}
else
{
//Enable button2
//Disable button1
}