Populating grid columns at runtime

Last post 03-17-2008, 4:54 PM by Marek. 3 replies.
Sort Posts: Previous Next
  •  03-05-2008, 11:01 AM 11050

    Populating grid columns at runtime

    Hi,

    We have a requirement , which states that the columns in the grid will be decided by the user, and the grid would populate with those selected columns dynamically during runtime. Will this be possible ? If yes how ???

    Thanks,

    Raji

     

     

     

  •  03-05-2008, 1:04 PM 11052 in reply to 11050

    Re: Populating grid columns at runtime

    Raji,

    When you design a grid, you have an option in UIEditor to make a column invisible. The user can later, at execute time, right-click on the grid header and un-hide a hidden column. There is no way to hide a column back this way, though. This method would solve your problem only partially.

    Another thing you can do is to use YourGrid.HideColumn FieldName, Hide dynamically from your CB code to hide/show grid columns.

    Keep in mind, that regardless of whether a column is visible or not, it is populated with a value when the underlying contextual object is filled.

    Marek @ Dovetail Software

  •  03-05-2008, 11:51 PM 11055 in reply to 11052

    Re: Populating grid columns at runtime

    Hi Marek...

    thanks for your response. However , i guess i was not clear enough with my question. I am looking at populating the grid dynamically at runtime. For example, Say i have a list of items displayed to the user . The user would select the items that he would like to see on the grid. Based on the selected list , can i generate the columns automatically on the grid and have the data populated. So if he selects case id , title and creation time, I should only populate these 3 fields or columns in the grid. would that be possible is what i am trying to seek help for ...have you tried anything like this earlier...please advise.

     Thanks,

    Raji  

     

  •  03-17-2008, 4:54 PM 11077 in reply to 11055

    Re: Populating grid columns at runtime

    Raji,

    When you design a grid you need to define a source of the data for it. This source must be a record of either a UDT or a database object (table or view) type. Before you fill the cobj for the grid you have an option to populate the records with only the data requested. You may also decide which columns to show.

    I sense that you are trying to optimize the application and retrieve only the data actually requested by the user. Keep in mind that when you retrieve data from the database, you always read entire rows - there is no way for the Clarify BulkRetrieve to read specific fields only and save time/processing cycles on the others. That's why you would usually define a view for your grid containing only the minimum number columns needed. Hiding/showing them later won't save you anything on database trips. Once the data is read, the columns may be hidden/shown per request, but the data is already there, just invisible.

    You may consider designing several views targeted at typical user's needs and eventually use a multitype grid dynamically switching between the views.

    Marek

View as RSS news feed in XML