I'm trying to build a datagrid similar to one found in shopping carts.
I need to have a couple of columns taken from a database query, 1 couple
where the user can enter a value in a text box(not edit a value, just
enter a value), and a button to confirm the action for that row and
update my database.
Since I'm not doing an edit, but a straight update, I'm not sure how to
trigger 1) my validation of what is entered in the text box, and 2) my
update of the database.
Here is my datagrid so far :
<asp:datagrid id="dgPersonalN umbering" runat="server"
AutoGenerateCol umns="False" ForeColor="#000 000"
BackColor="#dcd cdc" BorderColor="#0 00000"
HeaderStyle-Font-Bold="True" HeaderStyle-BackColor="#000 000"
HeaderStyle-ForeColor="#FFF FFF" Font-Size="8pt"
Font-Name="arial" CellPadding="3"
OnUpdateCommand ="dgPersonalNum bering_Update">
<Columns>
<asp:BoundColum n DataField="Numb er Type"
HeaderText="Num ber Type" ItemStyle-Width="90px" />
<asp:BoundColum n DataField="Desc ription"
HeaderText="Des cription" ItemStyle-Width="90px" />
<asp:BoundColum n DataField="Amou nt Available"
HeaderText="Amo unt Available" ItemStyle-Width="110px" />
<asp:TemplateCo lumn HeaderText="Qua ntity Required"
ItemStyle-Width="110px">
<ItemTemplate >
<asp:TextBox id="txtQuantity " runat="server"
width="65px" MaxLength="3" Font-Name="arial" Font-Size="8pt"
ToolTip="Enter Quantity" Text='<%# DataBinder.Eval (Container.Data Item,
"Quantity Required") %>' />
<asp:requiredfi eldvalidator ID="valQunatity "
ControlToValida te="txtQuantity " ErrorMessage="P lease enter a Quantity"
runat="server"> *</asp:requiredfie ldvalidator>
<asp:RegularExp ressionValidato r id="valQuantity RegEx"
ErrorMessage="P lease enter a valid Qunatity"
ControlToValida te="txtQuantity "
ValidationExpre ssion="^\d?\d?\ d$"
Display="Static "
runat="server">
*
</asp:RegularExpr essionValidator >
</ItemTemplate>
</asp:TemplateCol umn>
<asp:ButtonColu mn ButtonType=Link Button
HeaderText="Act ion" ItemStyle-ForeColor=Blue Text="Add To Cart"
CommandName="Up date" />
</Columns>
</asp:datagrid>
Any assistance would be really appreciated.
Thanks,
Mike
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!