Maybe "dynamic" wasn't the right word. We want the columns to change based
on the dataset like you suggested. Below is the aspx code for one of the
templates. We will need to build a dataset because the data is normalized,
so do you suggest building that from the stored procedure? Also, how will we
be able to use the validation controls?
Thanks,
Shawn
---------------------------------------------------------------------------------
<asp:TemplateColumn HeaderText="Caretaker Name">
<ItemTemplate><asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.CTKR_NM") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:RequiredFieldValidator id="Requiredfieldvalidator2" runat="server"
ErrorMessage="Enter a number between 0-120"
ControlToValidate="txtCaretakerAbuseCnt"></asp:RequiredFieldValidator>
<asp:TextBox id=txtCaretakerAbuseCnt runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.CTKR_ABUS_CT") %>'>
</asp:TextBox>
<asp:RegularExpressionValidator id="Regularexpressionvalidator2"
runat="server" ErrorMessage="Enter a number between 0-120"
ControlToValidate="txtCaretakerAbuseCnt"
ValidationExpression="^\d{1}$|^\d{2}$|^[1][0-1][0-5]$"></asp:RegularExpressionValidator> </EditItemTemplate>
</asp:TemplateColumn>
-------------------------------------------------------------------------------------------------
Sonu Kapoor said:
Why does it need to be dynamic? Creating dynamic datagrids isnt that easy and
can lead sometimes to many problems.
You could simply use a normal datagrid and pass your storedprocedure to it.
Just leave autogeneratecolumns to true and it will even build the columns for
you based on the stored procedure result.
How does that sound?
--
Sonu Kapoor - [MCP]
ASP.NET Moderator
WebSite:
http://www.Kapoorsolutions.com
Blog:
http://www.Kapoorsolutions.com/blog/
ASP.NET News:
http://www.Kapoorsolutions.com/reblogger/
:
Hi,
We have several sets of report data that we want to be able to edit from one
editable datagrid. We are storing the column heading names in the database
and want the aspx datagrid to be built dynamically from the data in the
database.
Basically we want to have one aspx page for all of the reports instead of
one aspx page for each report.
Please help
Shawn