Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Adding dynamically checkboxes and other columns
posted

Hello there,

I'm quite unfamiliar with the Infragistics components but the WebHierarchicalDataGrid is exactly what I have to use for a certain application.

Here's the thing:

 

- I have a DataSet with multiple DataTables inside, and they are connected to each other with the DataRelation property

- When I bind the connected DataSet to the WebHierarchicalDataGrid , everything works fine and I'm able to expand the rows

But here are my problems:

- I don't want do display the same data in the WebHierachicalDataGrid as in the DataSet,  I need additional checkbox columns and I have to remove columns. At the moment, it works fine for the "root" parent rows - I just manipulate the Grid in the .aspx file, set autogeneratecolumns = false and added the columns I need manually as BoundedFields and TemplateFields in the <columns> section. In the code-behind file, I iterate through the Grid and set the checkboxes as checked based on Data in the DataTable. The best way would be, of course, to generate checkboxes automatically based on a boolean value, but I haven't figured out yet how that works.

- What worked fine for my parent rows, doesn't work out for my children rows. I'm able to change the columns of the children by manipulating them in the handler-method of the RowIslandCreated()-event. Example:

            boundField = new BoundDataField(true);
            boundField.Key = "DURATION";
            boundField.Header.Text = "Duration";
            boundField.DataFieldName = "DURATION";
            contgrid.Columns.Add(boundField);

But how can I add a checkbox-column ? When I want to use the templatedatafield for that purpose, I have to provide a own checkbox-class for its ItemTemplate property. Isn't there a more elegant way to add a checkbox column ?

 

I would really appreciate if you could help me, it's really important.


Best regards,

Michael

Parents
No Data
Reply Children
No Data