Hello all,
I have been looking for a while now, and have not been able to find a solution for my problem, which could possible be very easy to fix.
I have a grid in which when the user selects a row I want it to stay highlighted. Simple enough, I can make it work, as long as there is no postback.
I have looked at numerous posts, including Telerik's demos (http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/selecting/row-selection/defaultvb.aspx?#qsf-demo-source, http://www.telerik.com/help/aspnet-ajax/grid-selecting-row-with-click-client-side.html) and yet, I cannot find a solution.
This is the style on my page:
This is the Grid's client settings:
Now, the rowClick JS:
Now, when the user clicks on a row, it stays highlighted as long as I remove the ajaxRequest.
I have also tried to set the EnablePostBackOnRowClick and using it instead of the Javascript, but the problem remains.
In an effort to force the row to be selected coming back, I have also added code to the AjaxRequest that sets the row.Selected = True. And I verified that it is still True during the Grid PreRender event.
BTW, I am not using the GridClientSelectColumn.
Can anyone shed a light as to what I am missing here?
Thanks,
Alex
I have been looking for a while now, and have not been able to find a solution for my problem, which could possible be very easy to fix.
I have a grid in which when the user selects a row I want it to stay highlighted. Simple enough, I can make it work, as long as there is no postback.
I have looked at numerous posts, including Telerik's demos (http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/selecting/row-selection/defaultvb.aspx?#qsf-demo-source, http://www.telerik.com/help/aspnet-ajax/grid-selecting-row-with-click-client-side.html) and yet, I cannot find a solution.
This is the style on my page:
<
style
type
=
"text/css"
>
.rgSelectedRow, .rgSelectedRow > td
{
padding:4px;
border-right: solid 1px #CBD2DA;
background:gray !important;
}
</
style
>
This is the Grid's client settings:
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"True"
></
Selecting
>
<
ClientEvents
OnRowClick
=
"namespace.rowClick"
/>
</
ClientSettings
>
Now, the rowClick JS:
rowClick: function (sender, eventArgs) {
var masterTable = $find('<%=grdSpam.RadGrid.ClientID%>').get_masterTableView();
var rowindex = eventArgs.get_itemIndexHierarchical();
var dataItem = masterTable.get_dataItems()[rowindex].get_element();
var spamFilterID = dataItem.attributes["SpamFilterID"].value;
$find('<%=pnlSpamQuarantine.ClientID%>').ajaxRequest('ViewFile' + '|' + spamFilterID + '|' + rowindex);
}
Now, when the user clicks on a row, it stays highlighted as long as I remove the ajaxRequest.
I have also tried to set the EnablePostBackOnRowClick and using it instead of the Javascript, but the problem remains.
In an effort to force the row to be selected coming back, I have also added code to the AjaxRequest that sets the row.Selected = True. And I verified that it is still True during the Grid PreRender event.
BTW, I am not using the GridClientSelectColumn.
Can anyone shed a light as to what I am missing here?
Thanks,
Alex