Home All Groups Group Topic Archive Search About
Author
7 May 2009 12:06 PM
John Straumann
Hello all:

I am working on a project where I need to retrieve some records from the CRM
database and display them in a grid for the end user. The challenge is that
the columns to be displayed in the grid are determined by user selections at
run time, one of the columns needs to be a checkbox, and one of the columns
needs to be a hyperlink that loads another ASPX page. I have the telerik
control toolkit and used the grid that comes with it to build the dynamic
grid, but I have hit the wall when trying to add the checkbox and hyperlink
columns.

There are TONS of examples out there on the ASP.NET datagrid, repeater
control, datalist, etc. but it seems like all of them use a pre-defined
columns and a predefined SQL query in the ASPX page, which I cannot do
because the SQL query is not known until the page runs. The data is
retrieved via the CRM web services so I need to run a loop from the returned
data, and build the datagrid rows in the loop.

When I asked someone at Microsoft why there were no examples of building a
datagrid from the code-behind file at runtime, he said "no, because you
should never do it" but unfortunately did not elaborate as to WHY I should
never do this or how I SHOULD do it. :)

Can anyone make a suggestion as to how I should attack this?

John.