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

[Solved] GridClientSelectColumn checkboxes alignment issue

1 Answer 188 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vaibhav Modak
Top achievements
Rank 1
Vaibhav Modak asked on 29 Oct 2009, 12:23 PM
Hi,

I am using the telerik rad grid to display a hierarchical grid to the users. The grid is bound to a dataset with both data tables for the master and detail view. Following is the code for the grid:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
<radG:EMGrid ID="radUserTypesGrid" runat="server" Width="95%" AutoGenerateColumns="False"
            AllowPaging="True" EnableAJAX="True" GridLines="None" AllowExport="true" AllowMultiRowSelection="True">
            <ExportSettings ExportOnlyData="true" FileName="Group User Types" />
            <ClientSettings AllowExpandCollapse="True">
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
            <MasterTableView Name="GroupAdminUserType" DataKeyNames="UserTypeID" HierarchyLoadMode="Client"
                Width="100%">
                <NoRecordsTemplate>
                    <div class="noRecords">
                        <asp:Label runat="server" ID="lblMasterError">No User Types are available.</asp:Label>
                        <br />
                    </div>
                </NoRecordsTemplate>
                <DetailTables>
                    <radG:GridTableView Name="GroupAdminUserJobType" DataKeyNames="UserTypeID" HierarchyLoadMode="Client"
                        Width="100%" runat="server">
                        <ParentTableRelation>
                            <radG:GridRelationFields DetailKeyField="UserTypeID" MasterKeyField="UserTypeID" />
                        </ParentTableRelation>
                        <NoRecordsTemplate>
                            <div class="noRecords">
                                <asp:Label runat="server" ID="lblChildError">No Job Types are available.</asp:Label>
                                <br />
                            </div>
                        </NoRecordsTemplate>
                        <Columns>
                            <radG:GridTemplateColumn UniqueName="DummyColumn">
                                <ItemTemplate>
                                </ItemTemplate>
                                <ItemStyle Width="30px" />
                            </radG:GridTemplateColumn>
                            <radG:GridClientSelectColumn UniqueName="chkUserJobType">
                                <HeaderStyle Width="5px" HorizontalAlign="Left" />
                                <ItemStyle Width="5px" HorizontalAlign="Left" VerticalAlign="Middle" />
                            </radG:GridClientSelectColumn>
                            <radG:GridBoundColumn HeaderText="" DataField="UserTypeID" UniqueName="UserTypeID"
                                Visible="false" />
                            <radG:GridBoundColumn HeaderText="" DataField="JobTypeID" UniqueName="JobTypeID"
                                Visible="false" />
                            <radG:GridBoundColumn HeaderText="Job Type" DataField="JobType" UniqueName="JobType" />
                            <radG:GridBoundColumn HeaderText="" DataField="Status" UniqueName="Status" Visible="false" />
                        </Columns>
                        <ExpandCollapseColumn Visible="False" />
                        <RowIndicatorColumn Visible="False" />
                    </radG:GridTableView>
                </DetailTables>
                <Columns>                    
                    <radG:GridClientSelectColumn UniqueName="chkUserType">
                        <HeaderStyle Width="10%" HorizontalAlign="Left" />
                        <ItemStyle Width="10%" HorizontalAlign="Left" VerticalAlign="Middle" />
                    </radG:GridClientSelectColumn>
                    <radG:GridBoundColumn HeaderText="" DataField="UserTypeID" UniqueName="UserTypeID"
                        Visible="false" />
                    <radG:GridBoundColumn HeaderText="" DataField="UserType" UniqueName="UserType" />
                    <radG:GridBoundColumn HeaderText="" DataField="Status" UniqueName="Status" Visible="false" />
                </Columns>
                <PagerStyle Mode="NextPrevAndNumeric" HorizontalAlign="Center" />
                <ExpandCollapseColumn />
                <RowIndicatorColumn Visible="False" />
            </MasterTableView>
        </radG:EMGrid>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
I am using the first column as GridClientSelectColumn for displaying checkbox column to the grid. The grid has a status column each for the master and detail view. The status column is used to set the GridClientSelectColumn check box check/uncheck state. I use the item databound event to check for the status value and check/uncheck the check box. On load, the grid is bound to the dataset and the check boxes are set properly - no issues at all (Please see the screenshot # 1). The problem is when I try to deselect a bound check box. As I uncheck the checkbox, the alignment gets disturbed and the screen looks very ugly (see screenshot # 2 for more details). I have tried to set the width of the columns and other options but no luck.

Please assist me with this issue.

Thanks,
Vaibhav Modak

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 03 Nov 2009, 02:50 PM
Hello Vaibhav,

From your code snippet I assume that you are using the classic RadGrid for ASP.NET instead of RadGrid for ASP.NET AJAX. To reproduce the issue locally I would need the correct version of the RadGrid control you are using.

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Vaibhav Modak
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or