473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DataGrid must be Bound before Editing

I have a sub named Bind("") which binds my a datagrid on my webform. In
order to enter edit mode and edit records on this datagrid, I must make a
call to Bind("") either before or after I place the DataGrid into edit mode.
For example, DataGrid.EditCommand looks like this ...

DataGrid1.EditItemIndex = e.Item.ItemIndex
Bind("")

Without having the Bind("") call within the EditCommand, an exception occurs
saying something to the extent of..."Failed to enable viewstate...".

The problem with including a call to Bind("") within the EditCommand is that
if there is a sort applied to my datagrid at the time the user enters 'Edit'
mode, the datagrid removes the sort, applying the original sort that it
possesses at load time, and the incorrect record is placed in EDIT mode. How
can I work around this?

Thanks.
Nov 19 '05 #1
1 1212
Hi Mr. Mike,

Yesterday, somebody asked similar question in group
dotnet.framework.aspnet.datagrid, Subject: DataGrid sort
when Editing, you can read the Q & A. If you think the
answer is not you want, please let us know.

HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
I have a sub named Bind("") which binds my a datagrid on my webform. Inorder to enter edit mode and edit records on this datagrid, I must make acall to Bind("") either before or after I place the DataGrid into edit mode.For example, DataGrid.EditCommand looks like this ...

DataGrid1.EditItemIndex = e.Item.ItemIndex
Bind("")

Without having the Bind("") call within the EditCommand, an exception occurssaying something to the extent of..."Failed to enable viewstate...".
The problem with including a call to Bind("") within the EditCommand is thatif there is a sort applied to my datagrid at the time the user enters 'Edit'mode, the datagrid removes the sort, applying the original sort that itpossesses at load time, and the incorrect record is placed in EDIT mode. Howcan I work around this?

Thanks.
.

Nov 19 '05 #2

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

Similar topics

3
by: Dmitry Akselrod | last post by:
Hi, I am using a standard .NET 1.0 Datagrid. Actually, I am using two, bound to a master-detail relationship. Both DataGrids are bound to a datasource. I have the MSDN version of the...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
11
by: Junkguy | last post by:
I need some help programmatically causing a row in a DataGrid to "flush" its contents to its bound data (in Visual Studio 6 using Windows Forms with C#). My issue is I want to send an update to...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
4
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...
0
by: Mark Kamoski | last post by:
Everyone-- I have a DataGrid that is bound at run-time. Upon the click of the Add, a new row is added to the top and it has several types of controls, (but, it is not permissible to use the...
3
by: Richard | last post by:
I've seen articles on GotDotNet and elsewhere on how to put a ddl in a datagrid, and have been able to implement this technique. For a new item, among the datagrid columns there is the one ddl for...
8
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit...
1
by: weird0 | last post by:
What is the difference between a DataList control and DataGrid control ? How and where are DataLists used? Can somebody place some good links for its use.
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.