You could use a Range Validator with the Type set to Currency. You'll have to set the MinimumValue and MaximumValue properties. Your minimum would likely be zero, with the max being whatever you decide. You could also use a RegularExpressionValidator and just use the regular expression for your currency of choice (or for any positive decimal). If this value is required, you also need to include a RequiredFieldValidator in addition to either of the above.
Hope this helps.
Thank you, but if you can give some codes will be great 'cause this is my first project using .net.
it would be something like this:
<asp:datagrid id="dg" ...>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<%#Container.DataItem("bla")%>
</ItemTemplate>
<EditItemTemplate>
<asp:textbox id="txb1" runat="server" />
<asp:RegularExpressionValidator .../>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
No comments:
Post a Comment