RadGrid EditItemtemplate css not working

2 posts, 0 answers
  1. Laxmi
    Laxmi avatar
    3 posts
    Member since:
    Jan 2013

    Posted 13 Feb 2013 Link to this post

    please check the below screen shot , i applied Edititemtemplate css but this is not working it is taking fixed width as 160px   how to set this grid as fixed width

    <telerik:RadGrid ID="grdComprehensiveParts" AutoGenerateColumns="false" AllowSorting="True"
                   PageSize="7" AllowPaging="True" runat="server" AllowAutomaticUpdates="false"
                   OnItemCommand="grdComprehensiveParts_ItemCommand" AllowAutomaticInserts="false"
                   OnInsertCommand="grdComprehensiveParts_InsertCommand" OnUpdateCommand="grdComprehensiveParts_UpdateCommand">
                   <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                   <MasterTableView CssClass="TableviewStle" HeaderStyle-CssClass="GridHeaderStyle"
                       CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="ComprehensivePartNo"
                       EditMode="InPlace" ItemStyle-CssClass="GridItemStyle" EditItemStyle-CssClass="GridItemStyle">
                       <CommandItemSettings AddNewRecordText="NewRecord" ShowRefreshButton="false" />
                       <Columns>
                           <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                               <ItemStyle CssClass="MyImageButton"></ItemStyle>
                           </telerik:GridEditCommandColumn>
                           <telerik:GridTemplateColumn HeaderText="InvoiceDate">
                               <EditItemTemplate>
                                   <telerik:RadDatePicker runat="server" ID="dpInvoiceDate" DbSelectedDate='<%#Eval("InvoiceDate")%>'>
                                   </telerik:RadDatePicker>
                               </EditItemTemplate>
                               <ItemTemplate>
                                   <asp:Label runat="server" ID="lblInvoiceDate" Text='<%#Eval("InvoiceDate")%>'></asp:Label>
                               </ItemTemplate>
                           </telerik:GridTemplateColumn>
                           <telerik:GridTemplateColumn HeaderText="InvoiceNumber">
                               <EditItemTemplate>
                                   <telerik:RadTextBox CssClass="GridEditTextbox" runat="server" ID="txtInvoiceNumber"
                                       Text='<%#Eval("InvoiceNumber") %>'>
                                   </telerik:RadTextBox>
                               </EditItemTemplate>
                               <ItemTemplate>
                                   <asp:Label runat="server" ID="lblLength" CssClass="GridLabelStyle" Text='<%#Eval("InvoiceNumber")%>'></asp:Label>
                               </ItemTemplate>
                           </telerik:GridTemplateColumn>
                           <telerik:GridTemplateColumn HeaderText="PartNumber">
                               <EditItemTemplate>
                                   <telerik:RadTextBox CssClass="GridEditTextbox" runat="server" ID="txtPartNumber"
                                       Text='<%#Eval("PartNumber") %>'>
                                   </telerik:RadTextBox>
                               </EditItemTemplate>
                               <ItemTemplate>
                                   <asp:Label runat="server" ID="lblPartNumber" CssClass="GridEditTextbox" Text='<%#Eval("PartNumber")%>'></asp:Label>
                               </ItemTemplate>
                           </telerik:GridTemplateColumn>
                           <telerik:GridTemplateColumn HeaderText="PartDescription">
                               <EditItemTemplate>
                                   <telerik:RadTextBox runat="server" ID="txtPartDescription" CssClass="GridEditTextbox"
                                       Text='<%#Eval("PartDescription") %>'>
                                   </telerik:RadTextBox>
                               </EditItemTemplate>
                               <ItemTemplate>
                                   <asp:Label runat="server" ID="lblPartDescription" Text='<%#Eval("PartDescription")%>'></asp:Label>
                               </ItemTemplate>
                           </telerik:GridTemplateColumn>
                           <telerik:GridTemplateColumn HeaderText="ReturnQuantity">
                               <EditItemTemplate>
                                   <telerik:RadNumericTextBox runat="server" ID="txtReturnQuantity" CssClass="GridEditTextbox"
                                       Text='<%#Eval("ReturnQuantity") %>'>
                                   </telerik:RadNumericTextBox>
                               </EditItemTemplate>
                               <ItemTemplate>
                                   <asp:Label runat="server" ID="lblReturnQuantity" CssClass="GridEditTextbox" Text='<%#Eval("ReturnQuantity")%>'></asp:Label>
                               </ItemTemplate>
                           </telerik:GridTemplateColumn>
                           <telerik:GridTemplateColumn HeaderText="ReturnDesc">
                               <EditItemTemplate>
                                   <telerik:RadTextBox runat="server" ID="txtReturnDesc" Text='<%#Eval("ReturnDesc") %>'>
                                   </telerik:RadTextBox>
                               </EditItemTemplate>
                               <ItemTemplate>
                                   <asp:Label runat="server" ID="lblReturnDesc" CssClass="GridEditTextbox" Text='<%#Eval("ReturnDesc")%>'></asp:Label>
                               </ItemTemplate>
                           </telerik:GridTemplateColumn>
                           <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                               ConfirmTitle="Delete" ImageUrl="../Vital Software Pty Ltd_files/Delete.gif" ButtonType="ImageButton"
                               CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                               <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                           </telerik:GridButtonColumn>
                       </Columns>
                   </MasterTableView>
                   <ClientSettings>
                       <ClientEvents OnRowDblClick="RowDblClick1"></ClientEvents>
                   </ClientSettings>
               </telerik:RadGrid>
  2. MasterChiefMasterChef
    MasterChiefMasterChef avatar
    152 posts
    Member since:
    Jan 2013

    Posted 13 Feb 2013 Link to this post

    Hi Laxmi,

    I'm not sure if this is going to solve all of your issues, but under the master table view you're first CssClass definition is for a file named "TableviewStle", which may be a typo from something like "TableViewStyle". The issue is present right here:
    <MasterTableView                    CssClass="TableviewStle" HeaderStyle-CssClass="GridHeaderStyle"
                       CommandItemDisplay="Top" AutoGenerateColumns="false"
                       DataKeyNames="ComprehensivePartNo"
                       EditMode="InPlace" ItemStyle-CssClass="GridItemStyle"
                       EditItemStyle-CssClass="GridItemStyle">
                       <CommandItemSettings AddNewRecordText="NewRecord"
                       ShowRefreshButton="false" />
                         <Columns>
     
     
                         </Columns>
    </MasterTableView>


    Hopefully fixing this typo may apply the styles you were looking for.

    Good luck,
    Master Chief
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top