Header not showing in DataGrid
This post has
1
verified answer and
4
replies
aerykian
Posted:
Tue Mar 13, 2012 @ 3:45 PM
Greetings!
I'm having difficulty getting the grid to show column headers. I've tried creating a client template for the heading, and using the same CSS with an ASP.Net datagrid - which shows the heading without any issies. I'm using product version 2009.3.1762.35. I'm defining the grid as follows:
<CA:DataGrid
id="gridStudent"
CssClass="Grid"
EnableViewState="true"
ShowFooter="true"
FooterCssClass="GridFooter"
RunningMode="Client"
Width="270"
Height="400"
EmptyGridText="No enrolled classes"
runat="server">
<Levels>
<CA:GridLevel
DataKeyField="UserLoginID"
ShowHeadingCells="true"
HeadingRowCssClass="GridHeader"
RowCssClass="GridItem">
<Columns>
<CA:GridColumn DataField="UserLoginID" Visible="false" />
<CA:GridColumn HeadingText="Student ID" DataField="DispStudentID" Width="90" Align="Left" FixedWidth="true" />
<CA:GridColumn HeadingText="Name" DataField="DisplayName" Width="180" FixedWidth="true" />
</Columns>
</CA:GridLevel>
</Levels>
</CA:DataGrid>
Firebug shows the grid is populating as expected. Am I missing something? Any help is greatly appreciated.
Verified Answer
aerykian
Posted:
Tue Mar 20, 2012 @ 4:48 AM
Okay,
Your code worked. I compared the ComponentArt grids to see what was different and couldn't find anything. Then I compared settings in web.config, and the only thing different was that I had it set to ClientIDMode="Static", and not "Auto-ID". Once I changed the ClientIDMode, it worked fine.
Hopefully this thread will save someone else some time one day :)
All Replies
ajay
Posted:
Wed Mar 14, 2012 @ 5:42 AM
aerykian
Posted:
Wed Mar 14, 2012 @ 7:50 AM
Hello! Thank you for responding. I've added 'ShowHeader="true"' to the grid definition, and the heading cells are still not showing. The rendered HTML shows that a blank space is being entered for the header items:
<table cellspacing="0" cellpadding="0" border="0" style="height:400px;width:270px;" class="Grid" id="ctl00_ContentPlaceHolder1_gridStudent">
<tbody>
<tr>
<td id="ctl00_ContentPlaceHolder1_gridStudent_header"></td>
</tr>
<tr>
<td valign="top" style="vertical-align:top;" id="ctl00_ContentPlaceHolder1_gridStudent_dom"> </td>
</tr>
<tr>
<td id="ctl00_ContentPlaceHolder1_gridStudent_footer" class="GridFooter"></td>
</tr>
</tbody>
</table>
In the CDATA section, the grid's .Data property shows five rows of test data, with three columns.
ajay
Posted:
Wed Mar 14, 2012 @ 11:37 AM
Hello,
Thanks for getting back to me.
Please find the attached sample application to show the header in Grid. I have tested it in ComponentArt version 2009.3.1762.35. Please test it and see if you are missing anything.
Thank you.
Ajay Mishra
aerykian
Posted:
Tue Mar 20, 2012 @ 4:48 AM
Okay,
Your code worked. I compared the ComponentArt grids to see what was different and couldn't find anything. Then I compared settings in web.config, and the only thing different was that I had it set to ClientIDMode="Static", and not "Auto-ID". Once I changed the ClientIDMode, it worked fine.
Hopefully this thread will save someone else some time one day :)