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

How to make row selection do postback?

4 Answers 200 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Max McKinney
Top achievements
Rank 1
Max McKinney asked on 24 Nov 2009, 12:20 AM
Hi,

Through Telerik's examples I know how to
-Cause Row Editing through a double or single  click on a row
-how to enable the highlighting of a row from the client side settings
-how to do client site row selection.  
by 
<ClientSettings EnableRowHoverStyle="true" >   
   <Selecting AllowRowSelect="True" />   
</ClientSettings> 
 

I'll I am interesting in having is the EnableRowHoverStyle="true" and if they click on a row it does a postback to the 

 

 

 

ItemCommand event for the grid?  Is this possible?  If so how is it done?  Last, where can I set the CommandName for this to happen?  I am not looking for a client event here.  I'm looking for a full postback.  I will handle the setting for the row being selected and all that in the code behind myself.

 

 

 

 

 

 

 

Thank you

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Nov 2009, 05:08 AM
Hello Max,

To get a full page postback on selecting rows in your grid, you can set the EnablePostBackOnRowClick property of the grid to true. Here's the link to the help article, where you can find more on this property:
Making postback/ajax request on client row click

Thanks
Princy.
0
Vance Smith
Top achievements
Rank 1
answered on 05 Jan 2010, 10:17 PM
Hi, I have a similar problem. I am doing full grid editing and as a user tabs from column to column and then eventually a new row I would like the newly "selected" row to become selected so that the SelectedIndexChanged event will occur. How do I do that?

Unfortunately, a user tabbing into one of the textboxes does not select the row...
0
Radoslav
Telerik team
answered on 08 Jan 2010, 01:18 PM
Hello Vance,

If you want a row in edit mode to be selected you need to do the selection manually. You could try using client side selection:

function ClientSideSelectedIndexChanged() {
    var masterTable = $find("<%=rgSchedule.ClientID%>").get_masterTableView();
    var dataItem = masterTable.get_dataItems()[0];
    dataItem.set_selected(true);
}

You could call  this function on OnBlur event on the controls which are in edit mode (for example : on the last control on the row). Then you could get the row index  in which the control are placed and get the row via masterTable.get_dataItems[rowIndex];

Another option to set item as selected is on the server, by setting its Selected property to true.

Additionally, if you could elaborate on your scenario and on what exactly you are trying to achieve, you could try providing a proper resolution for your case.

I hope this helps.

Best wishes,
Radoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
TonyG
Top achievements
Rank 1
answered on 22 Dec 2011, 09:55 PM
RE: Princy's link from nov-23-2009, the help topic is now here.
Tags
Grid
Asked by
Max McKinney
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Vance Smith
Top achievements
Rank 1
Radoslav
Telerik team
TonyG
Top achievements
Rank 1
Share this question
or