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

DataGridView select nothing first load

144 100+
hello,

how to make a datagridview to select no row after i bind it datasource to a datatable.

i have this code in my form load

myDGView.DataSource = myDataTable

then when the form load, the first load is automatically selected. because i implements the the SelectionChanged event of the datagridview (to fill some textboxes with the cells value of the current row), the textboxes in the form is filled with thet value of the first row in the datagridview.

i want to prevent this, so when the form first load, the textboxes are empty.

Thank you,
Nov 28 '08 #1
4 4705
nukefusion
221 Expert 100+
I'm not sure if you can prevent the event from firing. Is there any reason why in your form load event, after binding to the datasource, you can't just set the textboxes back to being empty?
Nov 28 '08 #2
thesti
144 100+
helo,

thanks for the reply.
well i've tried to emptied the textboxes when the form load but it's failed as the Selection_Changed event of the datagridview is fired five or six times approximately.

i've managed to find a workaround for this and seems that it works fine.

Thank you.
Nov 29 '08 #3
Hello thesti,

can you remember what your workaround was on this issue
and post it here?

thanks and cheers.
Dec 9 '09 #4
Frinavale
9,735 Expert Mod 8TB
Have you considered using a boolean to check if it's the first load?


-Frinny
Dec 9 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dave A | last post by:
Hi, I am struggling with two way databinding in WinForms and the DataGridView. I am binding to business object classes (rather than datatables). If I have a collection of these business...
11
by: Kevin | last post by:
I've been searching forever for examples of saving data changes in a DataGridView. There's all kinds of examples, but none really show how to save changes. Someone please help me. I have a...
3
by: Daniel Manes | last post by:
I need a strategy to debug this situation... I can't put all the code involved, but here are some of the critical lines with comments: ------------------------- Private _parentDataCell As...
4
by: Hexman | last post by:
Hello All, I'd like to find out the best way to add a cb column to a dgv and process efficiently. I see at least two ways of doing it. ------------------------------- 1) Add a cb to the dgv,...
7
by: Ryan | last post by:
I have a DataGridView which displays numeric (Int32) data from an underlying database. I want the numbers to be displayed in numeric format "#,###" (with commas). I want to also limit the user so...
0
by: Lawrence 007 | last post by:
Hi, This is my first big project. I have a form that is loaded with customer information. The datagrid is created with code as you can see below. I do not want the user to be able to update data...
1
by: Arved Sandstrom | last post by:
This seems to be something so simple that none of the hundred-odd tutorials and forum threads that I have looked at (:-)) apparently thinks it's a problem. In a nutshell, I have two...
1
by: TG | last post by:
Hi! I have an application in which I have some checkboxes and depending which ones are checked those columns will show in the datagridview from sql server or no. After that I have 2 buttons:...
0
by: Queez | last post by:
OK, this is rediculous... Surely, sorting should be one of the easiest things with the ASP.NET DataGridView control. I mean, there's hundreds of sites out there (Microsoft MSDN entries included)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.