This is a migrated thread and some comments may be shown as answers.

Clear checkbox in Grid on group header collapse

4 Answers 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pramod
Top achievements
Rank 1
Pramod asked on 01 Jul 2011, 10:57 PM
Hi ,

I have a grid that uses GroupByExpressions.In the grid columns, I am using GridClientSelectColumn(Checkbox) for selecting rows.
I want when user collpase a group, if user has checked any checkbox for that group, those checkbox should be cleared.

How can I achive this functionality. Please help.

Thanks

4 Answers, 1 is accepted

Sort by
0
komathi priya
Top achievements
Rank 1
answered on 02 Jul 2011, 09:26 AM
Hi,
try in the ItemDataBound event..

For more  clarification give your design..
0
komathi priya
Top achievements
Rank 1
answered on 02 Jul 2011, 09:54 AM
Hi,
try in the ItemDataBound event..

For more  clarification give your design..
0
Pramod
Top achievements
Rank 1
answered on 05 Jul 2011, 09:27 PM
Hi,

Is it possible to give some code sample, what to do in itemdatabound event.

Thanks for your help.

Thanks
0
Pramod
Top achievements
Rank 1
answered on 06 Jul 2011, 01:41 AM
Hi,

I found the solution. Here is the code if anyone wants to use this.

I put this code in grid prerender event

 

 


foreach
(GridGroupHeaderItem GroupHeader in grdGroupTeam.MasterTableView.GetItems(GridItemType.GroupHeader))

 

{

 

 

if (GroupHeader.Expanded == false)

 

{

 

 

// Get all child items for that group

 

 

 

GridItem[] children = GroupHeader.GetChildItems();

 

 

 

foreach (GridItem item in children)

 

{

 

 

 if (item is GridDataItem)

 

 {

  item.Selected =

 

false;

 

  }

}

}

}

Tags
Grid
Asked by
Pramod
Top achievements
Rank 1
Answers by
komathi priya
Top achievements
Rank 1
Pramod
Top achievements
Rank 1
Share this question
or