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

detect which groupbyfield was clicked

2 Answers 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
appdev
Top achievements
Rank 1
appdev asked on 05 Dec 2008, 03:19 AM
i want to be able to detect which group was click so i could expand that group and close the other
for example
apple
   sweet
   sour
strawberry
pears

so if i click on pears then the result should be this
apple
strawberry
pears
    verysweet

also if you ones all group items to display you can't allow paging so what do we need to do so that we could allow paging and still see all group items? thank you guys

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Dec 2008, 04:45 AM
Hi Duy,

Try the following code snippet to achieve single expand in a Grouped Grid.

CS:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "ExpandCollapse") 
        { 
            foreach (GridGroupHeaderItem groupitem in RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader)) 
            { 
                if (groupitem.Expanded && groupitem != e.Item) 
                { 
                    groupitem.Expanded = false
                } 
            } 
        } 
    } 



Thanks
Shinu.
0
appdev
Top achievements
Rank 1
answered on 05 Dec 2008, 11:26 AM
if you want all group items to display, you can't allow paging. So what do we need to do so that we could have allow paging turn on and still see all group items
Tags
Grid
Asked by
appdev
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
appdev
Top achievements
Rank 1
Share this question
or