RadGrid Style Error

3 posts, 0 answers
  1. AP
    AP avatar
    187 posts
    Member since:
    Apr 2010

    Posted 16 Mar 2011 Link to this post

    I've tried creating a new style in the Visual Style Builder, selecting just Grid from the control list. I;ve then downloaded the zip, and copied the files into my project.

    On one page, I've disabled the embedded styles of the RadGRid, and set the style to the name of the custom style.  I have also created links to the stylesheets:-

    <link href="App_Themes/Grid.TestStyle.css" rel="stylesheet" type="text/css" />
       <link href="App_Themes/Menu.TestStyle.css" rel="stylesheet" type="text/css" />
       <link href="App_Themes/Input.TestStyle.css" rel="stylesheet" type="text/css" />
       <link href="App_Themes/Slider.TestStyle.css" rel="stylesheet" type="text/css" />
       <link href="App_Themes/Calendar.TestStyle.css" rel="stylesheet" type="text/css" />

    In design mode the grid looks OK, showing the correct colours etc, but on running the page, I get the error:-

    Telerik.Web.UI.GridFilterMenu with ID='rfltMenu' was unable to find embedded skin with name 'TestStyle'. Please, make sure that you spelled the skin name correctly, or if you want to use a custom skin, set EnableEmbeddedSkins=false.



    The Radgrid definition is:-
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" 
                  AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource1" 
                  GridLines="None" Skin="TestStyle" Width="750px" AllowAutomaticDeletes="True" 
                  AllowAutomaticUpdates="True" onitemupdated="RadGrid1_ItemUpdated" 
              Culture="en-GB" EnableEmbeddedSkins="False">
                  <MasterTableView DataSourceID="SqlDataSource1" AutoGenerateColumns="False" 
                      DataKeyNames="Purchaser">
                      <CommandItemSettings ExportToPdfText="Export to Pdf" />
                      <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                      </RowIndicatorColumn>
                      <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                      </ExpandCollapseColumn>
                      <Columns>
                          <telerik:GridBoundColumn DataField="Purchaser" 
                              FilterControlAltText="Filter Purchaser column" HeaderText="Purchaser" 
                              ReadOnly="True" SortExpression="Purchaser" UniqueName="Purchaser">
                              <ItemStyle Width="150px" />
                          </telerik:GridBoundColumn>
                          <telerik:GridBoundColumn DataField="PurchaserName" 
                              FilterControlAltText="Filter PurchaserName column" HeaderText="Name" 
                              SortExpression="PurchaserName" UniqueName="PurchaserName">
                          </telerik:GridBoundColumn>
                          <telerik:GridBoundColumn AllowFiltering="False" DataField="ShortName" 
                              FilterControlAltText="Filter ShortName column" HeaderText="Short Name" 
                              SortExpression="ShortName" UniqueName="ShortName">
                          </telerik:GridBoundColumn>
                          <telerik:GridEditCommandColumn ButtonType="ImageButton" 
                              FilterControlAltText="Filter EditCommandColumn column" 
                              CancelImageUrl="Cancel.gif" EditImageUrl="Edit.gif" InsertImageUrl="Update.gif" 
                              UpdateImageUrl="Update.gif">
                          </telerik:GridEditCommandColumn>
                          <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" 
                              ConfirmText="Are you sure you wish to delete this record?" 
                              FilterControlAltText="Filter column column" Text="Delete" UniqueName="column">
                          </telerik:GridButtonColumn>
                      </Columns>
                      <EditFormSettings EditFormType="Template">
                          <EditColumn FilterControlAltText="Filter EditCommandColumn column" 
                              CancelImageUrl="Cancel.gif" EditImageUrl="Edit.gif" InsertImageUrl="Update.gif" 
                              UpdateImageUrl="Update.gif">
                          </EditColumn>
                          <FormTemplate>
                              <table style="width:100%;">
                                  <tr>
                                      <td style="text-align: right; width: 129px">
                                          Name:</td>
                                      <td>
                                          <asp:TextBox ID="TextBox2" runat="server" MaxLength="50" 
                                              Text='<%# Bind("PurchaserName") %>' Width="150px"></asp:TextBox>
                                          <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                              ControlToValidate="TextBox2" Display="None" ErrorMessage="Name is required!" 
                                              ValidationGroup="VG1"></asp:RequiredFieldValidator>
                                          <asp:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender" 
                                              runat="server" Enabled="True" TargetControlID="RequiredFieldValidator1">
                                          </asp:ValidatorCalloutExtender>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="style4" style="width: 129px; text-align: right">
                                          Short Name:</td>
                                      <td>
                                          <asp:TextBox ID="TextBox3" runat="server" MaxLength="15" 
                                              Text='<%# Bind("ShortName") %>' Width="110px"></asp:TextBox>
                                          <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                              ControlToValidate="TextBox3" Display="None" 
                                              ErrorMessage="Short name is required!" ValidationGroup="VG1"></asp:RequiredFieldValidator>
                                          <asp:ValidatorCalloutExtender ID="RequiredFieldValidator2_ValidatorCalloutExtender" 
                                              runat="server" Enabled="True" TargetControlID="RequiredFieldValidator2">
                                          </asp:ValidatorCalloutExtender>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="style4" style="width: 129px; text-align: right">
                                          Type:</td>
                                      <td>
                                          <asp:DropDownList ID="DropDownList5" runat="server" 
                                              SelectedValue='<%# Bind("Type") %>'>
                                              <asp:ListItem>Non-Midlands</asp:ListItem>
                                              <asp:ListItem>Midlands</asp:ListItem>
                                          </asp:DropDownList>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="style4" style="width: 129px; text-align: right">
                                          Sort Order:</td>
                                      <td>
                                          <asp:TextBox ID="TextBox4" runat="server" MaxLength="3" 
                                              Text='<%# Bind("SortOrder") %>' Width="50px"></asp:TextBox>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="style4" style="width: 129px; text-align: right">
                                          Corp Forms Group:</td>
                                      <td>
                                          <asp:DropDownList ID="DropDownList6" runat="server" 
                                              DataSourceID="SqlDataSource2" DataTextField="corpformsgroup" 
                                              DataValueField="corpformsgroup" SelectedValue='<%# Bind("CorpFormsGroup") %>'>
                                          </asp:DropDownList>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="style4" style="width: 129px; text-align: right">
                                          Corp Forms Sort:</td>
                                      <td>
                                          <asp:TextBox ID="TextBox5" runat="server" MaxLength="3" 
                                              Text='<%# Bind("CorpFormsSort") %>' Width="50px"></asp:TextBox>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td class="style4" style="width: 129px; text-align: right">
                                          NHS Net Address:</td>
                                      <td>
                                          <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("NHSNetAddress") %>' 
                                              Width="350px"></asp:TextBox>
                                      </td>
                                  </tr>
                              </table>
                              <br />
                              <table style="width: 300px;">
                                  <tr>
                                      <td style="width: 94px">
                                             
                                          <telerik:RadButton ID="RadButton1" runat="server" CommandName="Update" 
                                              Skin="WebBlue" Text="Update" ValidationGroup="VG1">
                                          </telerik:RadButton>
                                      </td>
                                      <td>
                                             
                                          <telerik:RadButton ID="RadButton2" runat="server" CausesValidation="False" 
                                              CommandName="Cancel" Skin="WebBlue" Text="Cancel">
                                          </telerik:RadButton>
                                      </td>
                                  </tr>
                              </table>
                          </FormTemplate>
                      </EditFormSettings>
                  </MasterTableView>
                  <FilterMenu EnableImageSprites="False">
                  </FilterMenu>
                  <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                  </HeaderContextMenu>
              </telerik:RadGrid>

    Any ideas why this is happening.

    Thanks
  2. Dimo
    Admin
    Dimo avatar
    8332 posts

    Posted 16 Mar 2011 Link to this post

    Hello Andrew,

    The error can be observed if you override the EnableEmbeddedSkins property of the filtering menu, which is a RadMenu. In standard scenarios the filtering menu will inherit the Skin and EnableEmbeddedSkins properties from the RadGrid. Please check in the code-behind or in the ASP.NET theme.

    By the way, CSS files, which are located inside the currently used ASP.NET theme, are registered automatically by the ASP.NET framework and you don't need to register them manually - actually in this case you will have them twice on the page.

    If the problem persists, we will need a runnable demo to take a look.

    Regards,
    Dimo
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. AP
    AP avatar
    187 posts
    Member since:
    Apr 2010

    Posted 16 Mar 2011 Link to this post

    Thanks for this.
     
    I unchecked the Enable Filtering on the General Features section of the Rad GRid tasks pop-up, and it all seems to work.

    The themes folder is a throwback to when the application had themes enabled (it's quite a long standing app that gets an upgrade every year), so they're not being included twice.
Back to Top