|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Build datagrid at runtime?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.
Problem creating TemplateFields in DetailsView dynamically
{0:c} causes input string not in correct format exception Rendering a GridView 2nd Post - {0:c} causes deletes to fail! programmatically create a gridview In a GridView i have a new dataset i want to show in it... Controling grdiview width in the update mode ... persistent objectdatasource Gridview - spaced between columns but not between rows. cell in DataGridView BindingNavigator to format date |
|||||||||||||||||||||||