How to edit in GridView using asp:BoundField-Urgent pls. reply asa

G

Guest

Hi

I am using asp:BoundField code for my GridView Control. Something like:

<asp:GridView ID="GridView2" runat="server" AutoGenerateEditButton="True"
OnRowEditing="GridView2_RowEditing">

<Columns>
............................
............................
<asp:BoundField HeaderText="Term Date"
DataField="termdate">
<ControlStyle Width="100px" />
</asp:BoundField>

..........................
..........................
</Columns>
</asp:GridView>


I need to edit this termdate. In the code-behind I am using the following
code for editing..

In the code-behind I am using the following code to edit the termdate:

protected void GridView2_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
GridViewRow row = GridView2.SelectedRow;
string enrollid = GridView2.Rows[e.RowIndex].Cells[4].Text.Trim();
updateEnrollRestriction(enrollid,
GridView2.Rows[e.RowIndex].Cells[4].Text.Trim());
}

Since my termdate column is converting to a editable textbox on Update-Click,
I am getiing the erollid as an empty string ?

Any ideas how I can make this work ?

Appreciate any help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top