I added a textbox column in the gridview by using the following code.
<asp:TemplateField HeaderText="Order">
<ItemStyle/>
<ItemTemp开发者_如何学JAVAlate>
<asp:TextBox ID="txtPriority" runat="server" width="15px" />
</ItemTemplate>
</asp:TemplateField>
The user will enter the an order for rows in the text box,which i have to use for my program. The issues that involved are 1.Preventing the user from entering duplicate values.we have to use javascript or jquery. 2.Persisting the values between gridview page changes.
My idea is to keep one hidden column in the grid and save the values into it as soon as user enter the value into textbox and thus persisting is done..
Give your ideas,Code snippets,links ...
Thanking you very much
- Javascript to prevent duplicate values is a fine idea.
- ViewState automatically persists the values. Do you not want to use ViewState?
精彩评论