I am using WHDG 12.1, and I am using a HierarchicalDataSource which is binded to a objectdatasource (DataSet). The data all loads fine, but I want to change the headers of the columns.
They are currently use the column name, but I want it to use the caption from the datacolumn within the dataset.
I know this would be easy to do in markup but I have no idea what information the user would be requesting, so is there anyway to find a column in codebehind and change the header.Text?
Another Problem: How would I hide a column in code based if DataColumn.ExtendedProperties.Count > 0? Again I don't know what column it would be, so I need it done in code
Any help would be great! Thanks
The aspx page mark up:
<ig:WebHierarchicalDataGrid ID="dataGrid2" runat="server" Height="600px" Width="100%" DataSourceID="WebHierarchicalDataSource1" ondatabound="dataGrid2_DataBound"> <GroupingSettings EnableColumnGrouping="True" /> <Behaviors> <ig:Sorting Enabled="true" /> <ig:ColumnMoving Enabled="true" /> <ig:ColumnResizing Enabled="true" /> <ig:VirtualScrolling Enabled="true" ScrollingMode="Virtual" /> </Behaviors> </ig:WebHierarchicalDataGrid> <ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server"> <dataviews> <ig:DataView ID="Data" DataMember="DefaultView" DataSourceID="ObjectDataSource1" /> </dataviews> </ig:WebHierarchicalDataSource> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" onobjectcreating="ObjectDataSource1_ObjectCreating" onselecting="ObjectDataSource1_Selecting" SelectMethod="getFilterData" TypeName="Convallis.CRM.Business.Filters.FilterHandler" onselected="ObjectDataSource1_Selected"> <SelectParameters> <asp:ControlParameter Name="filterID" ControlID="queryList" PropertyName="SelectedValue" Type="Int32" /> <asp:Parameter Name="clientID" Type="Int32" /> </SelectParameters> </asp:ObjectDataSource>
Hi fliteska,
You could submit a feature request for the grid displaying the CaptionName as the HeaderText. You are autogenerating columns, so the Columns collections of the Bands and ContainerGrids will all be empty. The columns that are displayed are in an internal Fields collection. You cannot access this. The only way to get to a field is off of a cell's Column property (this is after data binding, maybe in initialize row). Then you could set cell.Column.Header.Text or cell.Column.Hidden.
regards,David Young
I decided to set up the columns in code as I couldn't for the life of me figure how to do what I wanted, and my solution works alright now. just FYI, initializerow has no way of getting the cell, or atleast I can't find it.
Thanks though :))
Hello Fliteska,
Please let me know if I can provide any further assistance regarding this matter.
I have submitted your feature request to our product management team. Our product team chooses new feature requests for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your feature is chosen for development, you will be notified at that time. Your reference number for this feature request is PI12050073.
If you would like to follow up on your feature request at a later point, you may contact Developer Support management via email. Please include the reference number of your feature request in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Thank you for your request.