Sunday, March 11, 2012

Validation within datagrid

Hi Arjunende

You should be able to convert the columns over you datagrids to template columns. Once you do that you can add the .net validation controls to check for nulls.

Look in the tutorial for examples of the validators.

Hope this helps
Hi,

I did the same but it is validating for every row i want to validate for particular row

Thank in advance
Hi Arjunender,

Are all the rows editable at once or do you have to click an edit button to change a row to edit it?
hi,

I have a edit button for each row

Thanks
Hi Arjunender,

If you are editing one row at a time the only validation controls that should exist in the datagrid are the ones for the row that is being edited.

The validation controls should be put in the edit item template for each column when you click the edit item the only controls will be on the row that is edited.

If you have other buttons outside of the grid that care causing validation set their cause validation property to false.

Hope this helps


Hi,

Actually my datalist look like this

<asp:DataList ID=Datalist1 Runat=server DataKeyField="Section_Serial_No" ShowFooter=False >
<ItemTemplate>
<TABLE id="Table1" borderColor="<%=table_Bc%>" bgcolor=<%=td_bc%> cellSpacing="0" cellPadding="0" border="1" frame="void">
<TR>
<TD align="middle" height="28"> <asp:textbox id="textbox1" MaxLength="50" runat="server" Height="20px" Width="60"></asp:textbox> </TD>
<TD align="middle"> <asp:button id="Add_Details" runat="server" Height="22px" Width="60px" Text="Add" OnClick="Add_Details" ></asp:button> </TD>
</TR>
<tr>
<td colspan=2><asp:datagrid id=datagrid runat=server></datagrid></td>
</tr>
<table>
</ItemTemplate>
</asp:DataList
Now on clicking add button i want to check for null values and add to the inner datagrid

Thanks


Hi,

how to check nulls

Thanks

No comments:

Post a Comment