Hi,
I have the list of data on grid view with template fields.
I want to select the child rows if count is not equal to 0.
Whenever i populate the data, those child rows with count is 0 will be Hidden and IsSelected = false.
And those child rows with count is not 0 will be Visible and IsSelected = true.
My problem is the first child row to select is selected forever and unable to click.
Correct me if there are some problem with my code.
Currently using Q2
I have the list of data on grid view with template fields.
I want to select the child rows if count is not equal to 0.
Whenever i populate the data, those child rows with count is 0 will be Hidden and IsSelected = false.
And those child rows with count is not 0 will be Visible and IsSelected = true.
My problem is the first child row to select is selected forever and unable to click.
private
void
raddgvHistory_ViewCellFormatting(
object
sender, CellFormattingEventArgs e)
{
GridDetailViewCellElement cell = e.CellElement
as
GridDetailViewCellElement;
if
(cell !=
null
)
{
if
(cell.PageViewElement !=
null
)
{
bool
IsSelected =
false
;
for
(
int
iRow = 0; iRow < cell.PageViewElement.Items.Count; iRow++)
{
GridViewInfo viewInfo = cell.PageViewElement.Items[iRow].Tag
as
GridViewInfo;
if
(viewInfo.ChildRows.Count == 0)
{
cell.PageViewElement.Items[iRow].IsSelected =
false
;
cell.PageViewElement.Items[iRow].Visibility = ElementVisibility.Hidden;
}
else
{
if
(!IsSelected)
IsSelected = cell.PageViewElement.Items[iRow].IsSelected =
true
;
cell.PageViewElement.Items[iRow].Visibility = ElementVisibility.Visible;
}
}
}
}
}
Correct me if there are some problem with my code.
Currently using Q2