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

[Solved] MVC Grid Selectable is not working with RowAction

3 Answers 247 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Samir
Top achievements
Rank 1
Samir asked on 11 Aug 2010, 05:56 AM
Hi, 
When I am using the MVC Grid Beta (2010.2.713) and setting the RowAction as below, the Selectable stops working and I lose the hover funcationlity as below:

<%
    Html.Telerik().Grid(Model.AvFaxActiveBriefings)
       .Name("Grid")
       .DataKeys(d => d.Add(x => x.AvFaxid))
       .Columns(columns =>
       {
           columns.Bound(x => x.AvFaxid).Title("ID");
           columns.Bound(x => x.AvFaxNumber).Title("Number");
           columns.Bound(x => x.DateIssued).Title("Issued");
           columns.Bound(x => x.UpdateTill).Title("Update");
           columns.Bound(x => x.Format);
           columns.Bound(x => x.Target);
           columns.Bound(x => x.Content);
       })
       .Selectable()
       .RowAction(row =>
                      {
                          if(row.Index % 2 == 0)
                          {
                              row.HtmlAttributes["style"] = "background:#F0F0F0;";
                          }
                      })
       .Footer(false)
       .Render();
 %>


Thanks,
George

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 11 Aug 2010, 08:16 AM
Hi Samir,

If you want to change the alternating rows background, you should do it through CSS rather than through code. You can use the t-alt CSS class, like this:
.t-alt {
    background-color: #f0f0f0;
}


Regards,
Alex Gyoshev
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
Samir
Top achievements
Rank 1
answered on 11 Aug 2010, 08:33 AM
Thanks very much Alex for the prompt response.
Although I saw your answer in another thread but I am interested to know if the RowAction is used, would that stop the Selectable to work in the Beta version or not.

Thanks again.
George
0
Alex Gyoshev
Telerik team
answered on 11 Aug 2010, 09:18 AM
Hello Samir,

The RowAction that you are using produces inline style="" attributes that take precedence over the CSS styles. And because our styles are declared in the CSS, you practically override them with your code, disabling the styles for the selection and the hover styles. You can see the alt styles and selection working correctly together in the online demos with the webblue theme.

All the best,
Alex Gyoshev
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
Tags
Grid
Asked by
Samir
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Samir
Top achievements
Rank 1
Share this question
or