473,491 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem in editing DataGrid

Hi all,
I have a datagrid and I want to be able to edit a particular cell in
datagrid row.
I am using the EditCommandColumn control.My problem is when I hit
Edit the current row doesn't go in the edit mode.
Here is the snippet for asp:
<asp:EditCommandColumn EditText="Edit" CancelText="Cancel"
UpdateText="Update" HeaderText="Edit Column" ButtonType="LinkButton"
HeaderStyle-Wrap="False"
ItemStyle-Wrap="False"></asp:EditCommandColumn>
Here are my edit,update and cancel methods:
public void EditGrid(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
ReportDataGrid.EditItemIndex =
(int)e.Item.ItemIndex;
//ReportDataGrid.
int foo = (int)e.Item.ItemIndex;
daList.Fill(DS,"Recognition");
daRecipient.Fill(DS,"Recipients");
ReportDataGrid.DataSource = DS;
ReportDataGrid.DataBind();
}
public void Update(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string NewData;
TableCell NotesCell = e.Item.Cells[6];
TextBox EditBox;
EditBox = (TextBox)NotesCell.Controls[0];
NewData = EditBox.Text;
//TODO: modify the data in DB acc to the entry
ReportDataGrid.EditItemIndex = -1;
daList.Fill(DS,"Recognition");
daRecipient.Fill(DS,"Recipients");
ReportDataGrid.DataSource = DS;
ReportDataGrid.DataBind();
}
public void Cancel(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
ReportDataGrid.EditItemIndex = -1;
daList.Fill(DS,"Recognition");
daRecipient.Fill(DS,"Recipients");
ReportDataGrid.DataSource = DS;
ReportDataGrid.DataBind();
}
Any help will be appreciated.
Thanks!
MJ

Nov 17 '05 #1
0 941

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9905
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
1
15729
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template...
0
367
by: David | last post by:
Hello. I have some little problem with DataSet and I hope somebody will help me. So what's my problem: I have DataSet with some table in it lets say table name is "Suppliers", I have DataGrid...
4
4253
by: TT (Tom Tempelaere) | last post by:
Hi, Suppose there is a DataGrid on a form bound to a DataTable. When a user is editing a cell without leaving the cell, and then closes the form, the value is not updated to the underlying data...
3
3811
by: Islamegy | last post by:
When i press btn_save all changed rows in my grid get saved except the last editing row... I want my btn_Save to end editing in the datagrid.. so if user didn't press "enter" after editing last...
1
1829
by: Blake Versiga | last post by:
When editing a datagrid (C#) I need to know if the user changed the value of cell AND what the previous value was. Is this possible? If so how do I get the previous value or at least if the...
1
1597
by: Patrick.O.Ige | last post by:
Hello guys i made a Datagrid with Editing,Update and Cancel using VS.NET. to my surprise nothing is on the screen after compilation .. By code below:- Imports System.Data Imports...
9
4587
by: tshad | last post by:
Is there a way to use your own image in place of the automatic one that ASP uses when doing editing in your DataGrid pages? We already have a style of button we are using and would like to be...
8
1532
by: Scott Meddows | last post by:
I have a datagrid control that I've inherited from the base datagrid control (Source below). I am applying a datatable style onto the datatable that I assign as my datasource. All of my column...
0
1286
by: hanusoft | last post by:
This is an example of editing in DataGrid and Default Paging http://www.hanusoftware.com Html Design Code : - <asp:DataGrid id="DataGrid1" DataKeyField="id" runat="server" Height="224px"...
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.