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

RadGrid design is not stable

1 Answer 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
courtney shoell
Top achievements
Rank 1
courtney shoell asked on 18 Nov 2013, 09:02 AM
hi,

In  my rad gird i am using radbutton with button type as "ToggleButton" to fill the all the text boxes based on one calculation. it is working fine for functionality. But the problem is when ever the grid is in edit mode. the table layout is fixed and looks good. but When i click the radButton the grid design is not stable though it worked fine for functionality.  
Here i attached the screen shots before the button click and after the button click. Also the desing code.

Thank You.
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated"
        AllowSorting="True" AllowMultiRowSelection="False" OnItemCommand="RadGrid1_ItemCommand" AutoGenerateEditColumn="false" OnDataBound="RadGrid1_DataBound"
        OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand"
        OnPreRender="RadGrid1_PreRender">
 
        <MasterTableView DataKeyNames="TempAccountsId" ShowFooter="true" TableLayout="Auto" AllowMultiColumnSorting="True" EditMode="InPlace">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="CleaningId" CommandItemDisplay="Top" TableLayout="Fixed" Name="Cleaning" ShowFooter="true" EditMode="InPlace" AllowAutomaticUpdates="false">
                    <Columns>
                        <telerik:GridTemplateColumn Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblCleaningId" runat="server" Text='<%#Eval("CleaningId") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit" UniqueName="Edit" HeaderStyle-Width="70px" ItemStyle-Width="70px" HeaderStyle-HorizontalAlign="Center"
                            EditImageUrl="../Images/edit.gif" ItemStyle-HorizontalAlign="Center"  >
                        </telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn HeaderText="Delete" UniqueName="Delete" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="45px" ItemStyle-Width="45px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:ImageButton runat="server" ID="imgdelete" OnClientClick="return confirm('Are you sure that you want to Delete?');"
                                    ImageUrl="../Images/delete.gif" CommandName="Delete" CommandArgument="" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Description" UniqueName="Description" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="170px" ItemStyle-Width="160px">
                            <ItemTemplate>
                                <asp:Label ID="lblExplanation" runat="server" Text='<%#Eval("Description") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtDescriptionEdit" runat="server" Text='<%#Eval("Description") %>' Width="155px"
                                    MaxLength="180"></asp:TextBox>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtDescriptionInsert" runat="server" Width="155px"
                                    MaxLength="180" BorderWidth="1px"></asp:TextBox>
                            </InsertItemTemplate>
                            <FooterTemplate>
                                <asp:Label ID="lblSubtotalFooter" runat="server" Text="Sub Total"></asp:Label>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:Label ID="lblNotes" runat="server" Text='<%#Eval("Notes") %>' Visible="false"></asp:Label>
                                <asp:ImageButton ID="imgNotes" runat="server" ImageUrl="~/Images/TextboxHS.png" CommandArgument='<%#Eval("CleaningId") %>'
                                    CommandName="OpenWindowView" Visible="false" />
                            </ItemTemplate>
                            <HeaderStyle Width="30px" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Notes" UniqueName="Notes">
                            <ItemTemplate>
                                <asp:ImageButton ID="imgNotesEdit" ImageUrl="~/Images/edit.gif" runat="server"
                                    CommandName="OpenWindow" CommandArgument='<%#Eval("CleaningId") %>' />
                            </ItemTemplate>
                            <HeaderStyle Width="40px" />
                        </telerik:GridTemplateColumn>
 
                        <telerik:GridTemplateColumn HeaderStyle-Width="220px" UniqueName="Rate" HeaderText="Rate" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="210px"
                            HeaderStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:RadioButton ID="rdbtnPerSqft" runat="server" Text="PerSqft" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>' />
                                <asp:RadioButton ID="rdbtnFlat" runat="server" Text="Flat" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>' />
                                <asp:Label ID="lblPerSqFtRatedisplay" runat="server" Width="50px" Style="text-align: right;" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnPerSqftEdit" Width="40px" ButtonType="ToggleButton" CommandName="PerSqftRate" Text="PerSqft" runat="server" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>'>
                                </telerik:RadButton>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnFlatEdit" Width="20px" ButtonType="ToggleButton" CommandName="Flatrate" Text="Flat" runat="server" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>'>
                                </telerik:RadButton>
                                <asp:TextBox ID="txtRateEdit" runat="server" Width="80px" CssClass="AlgRgh" Visible="true" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'
                                    onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px"></asp:TextBox>
                                <asp:Label ID="lblRateEdit" runat="server" Visible="false" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'></asp:Label>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnPerSqftinsert" Width="40px" ButtonType="ToggleButton" CommandName="PerSqftinsert" Text="PerSqft" runat="server" GroupName="Rate">
                                </telerik:RadButton>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnFlatinsert" Width="20px" ButtonType="ToggleButton" CommandName="Flatrateinsert" Text="Flat" runat="server" GroupName="Rate">
                                </telerik:RadButton>
                                <asp:TextBox ID="txtRateinsert" runat="server" Width="80px"
                                    onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px"></asp:TextBox>
                            </InsertItemTemplate>
                        </telerik:GridTemplateColumn>
 
                        
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridTemplateColumn HeaderText="AccountId" UniqueName="TempAccountsId" Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lblTempAccountsId" runat="server" Text='<%#Eval("TempAccountsId") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Account Number" UniqueName="AccountNumber" ItemStyle-Width="120px" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                    <ItemTemplate>
                        <asp:Label ID="lblAccountNumber" runat="server" Text='<%#Eval("AccountNumber") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Account Name" UniqueName="AccountName" ItemStyle-Width="210px" HeaderStyle-Width="220px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                    <ItemTemplate>
                        <asp:Label ID="lblAccountName" runat="server" Text='<%#Eval("AccountName") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:Label ID="lbltotalFooter" runat="server" Text="Total:"></asp:Label>
                    </FooterTemplate>
                </telerik:GridTemplateColumn>
                
 
            </Columns>
        </MasterTableView>
        <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true">
        </ClientSettings>
    </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Venelin
Telerik team
answered on 21 Nov 2013, 09:07 AM
Hi Courtney,

Thank you for providing your code, but as far as I understand, this happens after button click. This means that I need to see how this functionality is implemented in order to provide a solution. You can provide your code here but it would be best if you open a support ticket and send a small runnable project that we can test and debug on our side.

I am looking forward to your reply.

Regards,
Venelin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
courtney shoell
Top achievements
Rank 1
Answers by
Venelin
Telerik team
Share this question
or