-
accessing editable DataGrid Field
Hi. This is my first project in ASP.Net with C#, and I am having trouble
accessing my editable textboxes in the datagrid. Here is the example of
the code that I am using:
The following is inside of a datagrid called DataGridComments
<Columns>
<asp:TemplateColumn HeaderText="Subject">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "subject") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="textBoxSubject" size="15" Text='<%#DataBinder.Eval(Container.DataItem,
"subject") %>' runat="server" />
</EditItemTemplate>
</asp:TemplateColumn>
When the user clicks on the Update button, the datagrid row turns into editable
text. So for instance I would like to access the changes that a user made
to the subject field, I have a function called Update_Comment which starts
like this:
void Update_Comment(object sender, DataGridCommandEventArgs e) {
DataSet dataSet = Comments_Load(); //Comments_Load() returns the current
dataset
int row = Convert.ToInt32(e.Item.ItemIndex);
How do I access the changed information in the textbox? Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks