473,721 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help - DataGrid

KB
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row
I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not
recorded (check it at the datagrid.valida ting event).
However, if I use down arrow key to move to the next row
(without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row
into the datatable without moving the arrow key ??

Thank you

AH
Nov 20 '05 #1
4 1299
Good question. I cant find a way of doing this easily, but I am sure that
there is a way. However, I am interested to know why you would want to add
blank rows to your grid ?

OHM

KB wrote:
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row
I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not
recorded (check it at the datagrid.valida ting event).
However, if I use down arrow key to move to the next row
(without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row
into the datatable without moving the arrow key ??

Thank you

AH


Regards - OHM# On**********@BT Internet.com
Nov 20 '05 #2
Maybe there is a way. On the currentCellChan ged event, you can compare the
rowIndex with the rows.count on the bound table. If the row is greater, you
could save it at this point.

Worth a try.

OHM
One Handed Man [ OHM# ] wrote:
Good question. I cant find a way of doing this easily, but I am sure
that there is a way. However, I am interested to know why you would
want to add blank rows to your grid ?

OHM

KB wrote:
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row
I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not
recorded (check it at the datagrid.valida ting event).
However, if I use down arrow key to move to the next row
(without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row
into the datatable without moving the arrow key ??

Thank you

AH


Regards - OHM# On**********@BT Internet.com


Regards - OHM# On**********@BT Internet.com
Nov 20 '05 #3
hi, nice to know that I'm not the only one facing this
problem. re 1st question I did not create a blank row. I
actually key in data but cursor did not leave that row. I
realised it does not create that row in datatable until
you actual move the cursor to next row.

yes .. that could work but i believe that must be a
better way ... could any expert care to help? I do a
validating event and the set focus back to grid and next
validating event will create that row into the
datatable ... strange.. therefore I believe there must be
some event or method that can force the record into the
datatable.

Rgds,

AH

-----Original Message-----
Maybe there is a way. On the currentCellChan ged event, you can compare therowIndex with the rows.count on the bound table. If the row is greater, youcould save it at this point.

Worth a try.

OHM
One Handed Man [ OHM# ] wrote:
Good question. I cant find a way of doing this easily, but I am sure that there is a way. However, I am interested to know why you would want to add blank rows to your grid ?

OHM

KB wrote:
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not recorded (check it at the datagrid.valida ting event).
However, if I use down arrow key to move to the next row (without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row into the datatable without moving the arrow key ??

Thank you

AH


Regards - OHM# On**********@BT Internet.com


Regards - OHM# On**********@BT Internet.com
.

Nov 20 '05 #4
I wouldnt swear to it, but this may be how it was intended to work !

OHM

an*******@discu ssions.microsof t.com wrote:
hi, nice to know that I'm not the only one facing this
problem. re 1st question I did not create a blank row. I
actually key in data but cursor did not leave that row. I
realised it does not create that row in datatable until
you actual move the cursor to next row.

yes .. that could work but i believe that must be a
better way ... could any expert care to help? I do a
validating event and the set focus back to grid and next
validating event will create that row into the
datatable ... strange.. therefore I believe there must be
some event or method that can force the record into the
datatable.

Rgds,

AH

-----Original Message-----
Maybe there is a way. On the currentCellChan ged event, you can
compare the rowIndex with the rows.count on the bound table. If the
row is greater, you could save it at this point.

Worth a try.

OHM
One Handed Man [ OHM# ] wrote:
Good question. I cant find a way of doing this easily, but I am sure
that there is a way. However, I am interested to know why you would
want to add blank rows to your grid ?

OHM

KB wrote:
I realised that if I use datagrid and datasource is a
datatable, when I created a new row and while on that row
I exit the datagrid (ie. without moving into the next
row) and focus onto another control, that new row is not
recorded (check it at the datagrid.valida ting event).
However, if I use down arrow key to move to the next row
(without keying any data) and exit, the new row is
recorded in the datatable.
can anyone please advise if I can force the datagrid row
into the datatable without moving the arrow key ??

Thank you

AH

Regards - OHM# On**********@BT Internet.com


Regards - OHM# On**********@BT Internet.com
.


Regards - OHM# On**********@BT Internet.com
Nov 20 '05 #5

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

Similar topics

5
3540
by: Steve M | last post by:
I have subclassed CollectionBase. I have also implemented GetEnumerator(). I have tried to set the DataSource of a DataGrid to an instance of my subclass. However, the items in the grid are not obtained via the Enumerator that I create in the GetEnumerator() method. I have tried elplicitly implementing IEnumerable on my sublass as well. Can anyone help on this? Thanks in advance.
0
1271
by: Junkguy | last post by:
I need to be able to tell if the blank row of a DataGrid has been edited or not. In a DataGrid, you may notice that if you click on the asterisk row, the asterisk will change to a triangle, but no "new" blank asterisked row will be added to the bottom *until* you type some data. How can I tell if you have begun to type data into this row or not? Here is the reason I need this. I need to call CurrencyManager.EndCurrentEdit() on a row...
6
1745
by: Teep | last post by:
Below is my code for dropdownlist that is populated from a SQL table. After a selection from the ddl, a datagrid is suppose to come up pertaining to the information selected, but I keep getting a DNS error. I developed this "simple" page but so far it is not simple! argh! <%@ Page Language="VB" Debug="true" Explicit="true" %> <%@ import Namespace="System.Data" %>
4
2278
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this dataSet updating lark when i realised that i think i am right back at square 1!!! Here's my scenario - i have a SQLDB and i retrieve all my data from that into a dataset and display this to a datagrid(WebForm). I have got this grid sorted and...
7
15441
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output the file to a folder, and then I read it back into the dataset using the dataset1.readxml. Up to this point, everything works wonderfully. The query executes, the dataset gets populated, and I get the results displayed in the datagrid.
6
4687
by: Coleen | last post by:
Hi All :-) Thanks for all of your help Cor :-) I can not get the code you sent me to work in my application. I'm using an aspx datagrid in a web form. I'm getting the following error message when I try this code: "Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier." Dim dr2 As DataRow = dt_stat_report_3b.NewRow Dim sum As Double =...
2
1767
by: Nina | last post by:
Hi there, I've tried everything that I know to prevent usre resizing datagrid columns, but nothing works. Following are the code that I used. Please tell me what's wrong with them. Thank you. P.S.: dg is datagrid Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
2
2016
by: Bill nguyen | last post by:
I've been using Datagrid for most of my app's data entry screens. Now I have the need for users to select multiple rows for printing. Is it possible with Datagrid items? Thanks Bill
6
1276
by: Frank | last post by:
Can someone please tell me when the ViewState is loaded? My understanding, based on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconControlExecutionLifecycle.asp is that it should be loaded before the Page_Load event, however, given the following code I don't get the expected results. private void Page_Load(object sender, System.EventArgs e) { if (Page.IsPostBack & ViewState != null)
2
1447
by: settyv | last post by:
Hi, I have webform which has 4 Datagrid controls with (built-in Pagination) and 4 search buttons to perform the search operation.When i click on search operation it is displaying the results in grid .when i click next it is telling error...Please let me know how to solve this problem. Below method can be used for all the datagrids.
0
8738
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9230
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9148
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8026
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6678
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5994
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4499
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2596
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2146
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.