473,545 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EditCo mmand looks like this ...

DataGrid1.EditI temIndex = e.Item.ItemInde x
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 1224
Hi Mr. Mike,

Yesterday, somebody asked similar question in group
dotnet.framewor k.aspnet.datagr id, 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********@hotm ail.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.EditCo mmand looks like this ...

DataGrid1.Edit ItemIndex = e.Item.ItemInde x
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
3320
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 DateTime picker functioning quite well in the datagrid. I am also tracking a double-click event within another column in the datagrid. The column is...
19
4072
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 the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can...
11
5906
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 a database from a menu command while the user is editing a DataGrid. This is unusual in regard to examples and normal practice in that the cell of...
3
2531
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 "Resource" with the following structure : Resource{,en,fr,es} Yes.. these are the only languages supported actually. A couple of rows in that table would...
4
4259
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 source. How can I accomplish this? Thanks, --
0
1341
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 built-in editing functionality of the DataGrid). The DataGrid is bound.
3
1800
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 the user to choose an account description, and when the user saves, then the value is saved and displayed in a bound column in the datagrid. So far...
8
1974
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 button. There are a lot of fields across, and my Network Admins would like a way of editing/updating each issue seperately in a a vertical form. I...
1
1552
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
7487
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7934
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7778
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6003
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3476
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1908
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 we have to send another system
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.