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

Selecting row in RadGrid

4 Answers 198 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sid
Top achievements
Rank 1
Sid asked on 11 Oct 2010, 02:38 PM
Hi,

In standard MS GridView I was using this code;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)     //set settings only to rows
    {
        e.Row.Attributes.Add("onmouseover", "javascript:this.className = 'rowOnMouseOver'");
        e.Row.Attributes.Add("onmouseout", "javascript:this.className = ''");
        e.Row.Attributes.Add("onclick", ClientScript.GetPostBackClientHyperlink(this.GridView1, "Select$" + e.Row.RowIndex.ToString()));
    }
 
}
to make highlights and selections for rows in GridView.
What would be an equivalent for RadGrid?

4 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 12 Oct 2010, 09:57 AM
Hello Sid,

The following documentation which elaborates  how to set style for grid rows on mouse over.
Set style on mouse over

And the following documentstion shows how to select a grid row.
Set style on mouse over
Selecting a row with a select button (server-side)

Thanks,
Princy.
0
Sid
Top achievements
Rank 1
answered on 12 Oct 2010, 10:30 AM
I already checked
Selecting a row with a click (client-side)
Selecting a row with a select button (server-side),
but Selecting a row with a click (client-side) is only client side, I need server side.
Solution Selecting a row with a select button (server-side) is implemented with two additional column commands, I don't want that.

So to rephrase my question. Is it possible to trigger server-side select with clicking inside row without using select/deselect commands?
0
Accepted
Princy
Top achievements
Rank 2
answered on 13 Oct 2010, 08:52 AM
Hello Sid,

If you want to trigger postback to the server when the user clicks a grid data row, you can just set the ClientSettings -> EnablePostBackOnRowClick property of the grid to true. To know more on this please go through the following documentation.
Making postback/ajax request on client row click

Thanks,
Princy.
0
Sid
Top achievements
Rank 1
answered on 13 Oct 2010, 02:10 PM
Thanks, exactly what I was looking for...
Tags
Grid
Asked by
Sid
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Sid
Top achievements
Rank 1
Share this question
or