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

Server-side selection - double click row to select

9 Answers 514 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 14 Sep 2010, 09:54 PM
How can I modify your server side example so that you can double  click anywhere in the row to select the row?

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectrowwithcheckbox/defaultcs.aspx

Also how do you add tooltips to the row/cell values?

thanks again

9 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Sep 2010, 08:08 AM
Hello Jon,

You can try the following approach to select a row when double clicking on it.

ASPX:
<ClientSettings>
       <ClientEvents OnRowDblClick="OnRowDblClick" />
 </ClientSettings>

Java Script:
<script type="text/javascript">
    function OnRowDblClick(sender, args) {
       var index = args._itemIndexHierarchical;
       __doPostBack("<%= RadGrid1.UniqueID %>", index);
    }
</script>

C#:
protected override void RaisePostBackEvent(IPostBackEventHandler source, string eventArgument)
   {
       base.RaisePostBackEvent(source, eventArgument);
       GridDataItem item = (GridDataItem)RadGrid1.MasterTableView.Items[eventArgument];
       item.Selected = true;
   }


In order to add ToolTip for any cell, access that TableCell in ItemDataBound event and set ToolTip like below.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridDataItem)
       {
           GridDataItem item = (GridDataItem)e.Item;
           TableCell cell = (TableCell)item["ColumnUniqueName"];
           cell.ToolTip = item["ColumnUniqueName"].Text;
       }
   }

Thanks,
Princy.

0
Jon
Top achievements
Rank 1
answered on 15 Sep 2010, 11:52 AM
Hi..
I'm getting an error on 

   GridDataItem item = (GridDataItem)RadGrid1.MasterTableView.Items[eventArgument];
   
The value appears to be 'RowClick'  ??


Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex


help... thanks
0
Jon
Top achievements
Rank 1
answered on 15 Sep 2010, 12:29 PM
Also when I double click the entire grid gets highlighted... thx
0
Jon
Top achievements
Rank 1
answered on 15 Sep 2010, 12:45 PM
Also I need this to allow multiple selections.. it doesn't appear to do that...
thanks
0
Mira
Telerik team
answered on 15 Sep 2010, 04:30 PM
Hello Jon,

I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality can be implemented. You can find it attached to this message.

I hope it helps.

Greetings,
Mira
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jon
Top achievements
Rank 1
answered on 15 Sep 2010, 05:19 PM
Great.. thx
0
gopal
Top achievements
Rank 1
answered on 01 Oct 2010, 01:08 PM
thanks it helped me lot
0
Saul
Top achievements
Rank 1
answered on 11 Feb 2014, 01:54 PM
Hi 

I have problem with my Telerik Grid. when i add Selectable() property its working superb. When i select any row i opened pop up and it works just one click but i want to open taht popup with double click

Please give me advice how can i do it?

I'm using MVC elements 
0
Maria Ilieva
Telerik team
answered on 14 Feb 2014, 09:37 AM
Hi Saul,

Could you please post your question in separate post under the proper UI for ASP.NET MVC forum category in order  to have our MVC team directly work on the issue.

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jon
Top achievements
Rank 1
Mira
Telerik team
gopal
Top achievements
Rank 1
Saul
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or