473,548 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EditI temIndex 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 1209
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*******@gmai l.com> wrote in message
news:ON******** ******@TK2MSFTN GP15.phx.gbl...
I have a very simple datagrid, with an edit button that I added in
PropertyBuilde r. 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.EditI temIndex 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*******@gmai l.com> schreef in bericht
news:ON******** ******@TK2MSFTN GP15.phx.gbl...
I have a very simple datagrid, with an edit button that I added in
PropertyBuilde r. 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.EditI temIndex 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
1203
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 sign + that i need to deploy for exploring my table. is there a way to supress that node sign and display directly table information ?
3
2373
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 things. The method I am writing queries a large dataset. As part of my feedback to the user, I am updating the status bar when the connection is made...
0
2586
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 find one, I'm posting the question in hope some one of you guys out there will have the answer for me...! I'll start with what I have, then I'll...
4
1361
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 line between them. But...................... I want that this line must be dash and I don't find any control that allows that. At the moment I'm...
1
1175
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 dropdownbox controls. What I want if user put some values in textbox (for ex. ProductID), ProductName automatic select in next column or if user select...
1
1010
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 datagrid). Unfortunately, I get this error with "newtier2" being the name of my ..ascx page... "Literal content ('</ItemTemplate> </asp:TemplateColumn>...
2
1112
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 updating data in a SQL database via an application that utilizes a dataset, dataadapter and datagrid. User A retrieves data from data source and sits...
13
1843
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 query: OleDbDataAdapter1.SelectCommand.CommandText = & _ "Select illNameE From tblIllness" OleDbDataAdapter1.Fill(DsIllness1) But in my...
1
1047
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 to realisticaly display on each line in the datagrid. My question... How do I allow it, so that if I were to doubleclick (or use the enter key)...
0
7512
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
7707
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
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
6036
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
5082
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1926
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
0
751
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.