Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Grid > MVC Grid Selectable is not working with RowAction

Not answered MVC Grid Selectable is not working with RowAction

Feed from this thread
  • Samir avatar

    Posted on Aug 11, 2010 (permalink)

    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

    Reply

  • Alex Gyoshev Alex Gyoshev avatar

    Posted on Aug 11, 2010 (permalink)

    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

    Reply

  • Samir avatar

    Posted on Aug 11, 2010 (permalink)

    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

    Reply

  • Alex Gyoshev Alex Gyoshev avatar

    Posted on Aug 11, 2010 (permalink)

    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Grid > MVC Grid Selectable is not working with RowAction
Related resources for "MVC Grid Selectable is not working with RowAction"

ASP.NET MVC Grid Features  |  Documentation  |  Demos  |  Telerik TV ]