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
80
Adding Dynamic rows and columns
posted

Hi I have creating hierarchical grid dynamically.  I have two Datatable which will be used to populate.  I do not want to display all the columns by turning on AutogenerateColumns = true.  I would like to customize the columns.  At Bind level 0 I would like to have a header column which will contains values from few columns.  For an example,

DataTableOne has columns Month, Year, Name.  I would like to have the Bind level 0 rows will be "Name - Month - Year" as one column not as 3 different columns.

After that at Bind Level 1 rows would have selected columns from DataTableTwo.  Lets say I have 10 columns in DataTableTwo but I would like only have 5 columns and add additional columns for hyperlink.  For bind level 1 I want to add a button at the footer. I have accomplish this all dynamically.

1) Create a single column combined of few columns at Bind[0]

2) Choosing the columns from DataTableTwo at Bind[1].

3) Add additinal hyper link column to the rows at Bind[1] 

4) Adding button at the footer at Bind[1].

 Can I do all this dynamically? If it is possible to do, can someone please help me to achieve this?  

Thank you. 

  • 8680
    posted

    I've done most of that, not dynamically, but using the designer.  But as almost all of the properties can be manipulated at run time, you should be able to make it work.  Here's what I would do in the designer; you'll have to figure out which event handlers to use for which tasks.

    • Turn off AutoGenerateColumns
    • Create each band, column by column.
    • Generate a dataset containing all the tables and their relationships.  (See http://forums.infragistics.com/forums/p/3298/17902.aspx#17902)
    • Use a grid column's .BaseColumnName to bind it to a datasource column.
    • Set a link column's .Type to "HyperLink".  (I'm not sure how to set text & URL; I'd try searching this forum for "HyperLink")
    • I've never put anything in a footer, but I'd look for how to add controls to a Band's .FooterLayout.  (Again, searching this forum ...)

    And after checking into all that, post back here with any questions, or to let us know how it went.  (If you can fill in any of the gaps in my post, it'll be a big help to the next developer.  ;-)