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
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