Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 datagrid columns dynamically from a stored procedu

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-11-03 : 23:26:45
Do you know if it s possible to:

from a stored procedure, get all the returned columns and build the datagrid clumns accordinally (each column returned by the Stored Procedure will correspond to a column of the asp.net datagrid column) so that we can populate the datagrid after with the resulting resultset from the SP.
Tank you

dfiala
Posting Yak Master

116 Posts

Posted - 2006-11-03 : 23:52:35
Either in your code or in the HTML set

AutoGenerateColumns=true

then bind the grid

it will automatically fill the grid with the returned results

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclassautogeneratecolumnstopic.asp

Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-11-04 : 16:11:14
Thanks Dean, but I also want to customize a column or two as a hyperlink to another page with sending the value of the column row value to the target page.
Will I be able to do that with datagrid and AutoGenerateColumns=true or should I adopt a diferent approach.
Thank you
Go to Top of Page

dfiala
Posting Yak Master

116 Posts

Posted - 2006-11-04 : 19:35:03
Yes, you can also add custom columns at design time -- the autogenerated columns will appear after the custom columns, or at run time.

Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-11-04 : 20:14:05
cool thanks a lot Dean
Go to Top of Page
   

- Advertisement -