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

[Solved] Row click behave like Expand

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ernest Mombay
Top achievements
Rank 1
Ernest Mombay asked on 17 Jul 2009, 05:48 PM
Hello all,

Is there a way for the row click to behave like expand? I ask this because I want the clicking of a RadGrid row to post back and then the CommandName be ExpandCollapse. This way, the ItemCommand event will only be called once.

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 20 Jul 2009, 05:36 AM
Hi Ernest Mombay,

Try the following code snippet in order to expand/collapse row on clicking.

C#:
 
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    if (e.CommandName == "RowClick" || e.CommandName == "ExpandCollapse"
    { 
        e.Item.Expanded = !e.Item.Expanded; 
    } 

-Shinu.
Tags
Grid
Asked by
Ernest Mombay
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or