473,407 Members | 2,629 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,407 software developers and data experts.

Very Simple DataGrid Question

I have a very simple datagrid, with an edit button that I added in
PropertyBuilder. This fires the EditCommand event just fine and I show a
panel where the user can edit certain fields. I have a button to save the
changes. Within that button, I refer to dataGrid1.EditItemIndex and it's
returning -1. Isn't this property set when I click on the edit button
within the grid?
Nov 21 '05 #1
2 1196
Scratch that question, I'm an idiot. My real question is that I don't want
to do editing within the grid, I want to populate controls outside of the
grid and then save/rebind.

I'm able to handle the Edit Command and populate the controls, but when I
want to save it back to the dataset, I need to refer to the record that was
selected within the grid. How can I refer to the item that was selected
within my grid, without setting something explicitly in a session variable
or something like that?
"James" <mi*******@gmail.com> wrote in message
news:ON**************@TK2MSFTNGP15.phx.gbl...
I have a very simple datagrid, with an edit button that I added in
PropertyBuilder. This fires the EditCommand event just fine and I show a
panel where the user can edit certain fields. I have a button to save the
changes. Within that button, I refer to dataGrid1.EditItemIndex and it's
returning -1. Isn't this property set when I click on the edit button
within the grid?

Nov 21 '05 #2
James,

In my opinion is this a WebForm datagrid. It is again a while ago I used
that, however in my opinion do you have first to select the row and than you
can use the other buttons.

It is nicely explained on MSDN in this page

http://msdn.microsoft.com/library/de...dWriteData.asp

I hope this helps,

Cor

"James" <mi*******@gmail.com> schreef in bericht
news:ON**************@TK2MSFTNGP15.phx.gbl...
I have a very simple datagrid, with an edit button that I added in
PropertyBuilder. This fires the EditCommand event just fine and I show a
panel where the user can edit certain fields. I have a button to save the
changes. Within that button, I refer to dataGrid1.EditItemIndex and it's
returning -1. Isn't this property set when I click on the edit button
within the grid?

Nov 21 '05 #3

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

Similar topics

1
by: serge calderara | last post by:
Dear all, I have a simple datagrid binding to a datasource dataset object that collect a simple table from a database. When I get data from that table, my datagrid appeard with a tree node...
3
by: Elliot Rodriguez | last post by:
Hi: I am writing a WinForm app that contains a DataGrid control and a StatusBar control. My goal is to update the status bar using events from a separate class, as well as some other simple...
0
by: roiavidan | last post by:
Hi, I'm having a bit of a problem with a small application I wrote in C#, which uses an Access database (mdb file) for storing financial data. After looking for a similiar topic and failing to...
4
by: ruca | last post by:
Hi, I have an web application with fields that must be the filters for some results. To show the result I have a datagrid. So far so good. To distinguish filter fileds from datagrid I put a...
1
by: Amit | last post by:
Hi All, In one of my web form we are using datagrid server control. There are 5 columns (Sr.No,ProductID,ProductName,Quantity,Rate) in the gird. In footer or edit template I used textbox and...
1
by: Roy | last post by:
I have a datagrid, within that datagrid I have <columns> tag and within that I have the below TemplateColumn which calls to another datagrid (essentially and embedded datagrid within another...
2
by: Rich Wallace | last post by:
I know datasets have been beaten to death in here, I have what is hopefully a simple question about the integrity of a dataset when used in an application. Scenario: User A and User B are...
13
by: Saber | last post by:
I did a lot of searches and read something about datagrids. But I couldn't find the answer of my simple question, how can I show only my desired columns of a table? for example I wrote this sql...
1
by: Jason | last post by:
Hello I've got a VB.net datagrid that I use to display some inforamtion from a Acess DB. In my datagrid I only display a few items of informatin, because there are just to many cells per tuple...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...
0
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...
0
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,...

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.