After adding a new row (programmatical ly) to a table/view that is being
displayed in the DataGridView control, the new row appears in the
DataGridView grid. Now, how do I select that new row?
If the DataGridView is sorted by one of the columns/fields, the new row
could show up anywhere (based on the sort criteria).
Thanks. 2 2029
Hi Bob,
maybe this helps:
void Grid_RowsAdded( object sender, DataGridViewRow sAddedEventArgs e)
{
_grid.FirstDisp layedCell =
_grid.Rows[e.RowIndex].Cells[0];
}
"bo*@datasync.c om" wrote:
After adding a new row (programmatical ly) to a table/view that is being
displayed in the DataGridView control, the new row appears in the
DataGridView grid. Now, how do I select that new row?
If the DataGridView is sorted by one of the columns/fields, the new row
could show up anywhere (based on the sort criteria).
Thanks.
Thanks for the idea. (What do you know -- there's a "RowsAdded" event
in the thing!). But no, it doesn't help, because "e.rowindex " returns 0
-- I guess the new row gets put first on the grid. But then, if the
grid is sorted (which it always is, in my app), the new row immediately
gets put somewhere else, so the "0" points to the new first row, which
is NOT the one just added. Good idea, though. It makes me want to try
harder to look through all the possible events when I have this kind of
problem. That's something I still need to do with this problem!
wansch wrote:
Hi Bob,
maybe this helps:
void Grid_RowsAdded( object sender, DataGridViewRow sAddedEventArgs e)
{
_grid.FirstDisp layedCell =
_grid.Rows[e.RowIndex].Cells[0];
}
"bo*@datasync.c om" wrote:
After adding a new row (programmatical ly) to a table/view that is being
displayed in the DataGridView control, the new row appears in the
DataGridView grid. Now, how do I select that new row?
If the DataGridView is sorted by one of the columns/fields, the new row
could show up anywhere (based on the sort criteria).
Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: dbuchanan |
last post by:
Hello,
Is this a bug?
Is there some kind of work around?
I want to add default values for a few columns in my datagridview
I found the "DefaultValuesNeeded" event for the datagridview
I gave it a try using the example given in
|
by: inpuarg |
last post by:
Is it possible that - or is there any workarround for adding a new unbound row
to a datagridview at bound mode ?
Theese are not working. And i don 't want to add a row to dataset then rebind -
cause i want to add this row to a specific location. and it does not match to
sort order.
Regards. and thanks.
base.Rows.InsertCopy(base.CurrentRow.Index, 1);
base.Rows.Insert(base.CurrentRow.Index, 1);
|
by: Ian Semmel |
last post by:
I have a DataGridView bound to a DataTable which is keyed on an Identity.
Now I want users to be able to fill in the table just by enetering data and tab
between fields and across row boundaries.
What I am having trouble with is deciding when to update the table and I keep on
getting exceptions (like DbNull).
Do you have to do an update at the end of each row ?
|
by: Christopher Lusardi |
last post by:
Hello,
I have a datagridview that is too wide for the form, so I'm trying
to put scrollbars on the form and the datagridview table. But, when I
run the application, look at the rightmost cells, and click on one of
the rightmost cells the form scrolls to the leftmost end of the
datagridview. I tried various permutations of the form's autoscroll,
the datagridview's scrollbars, and the datagridview's selection mode
without success. What do...
|
by: kristian |
last post by:
Hi all
I have a simple form with not much more than a datagridview control,
and want to show and edit the contents of a table in my mysql table.
So far I have managed to set the db table as a datasource for the
datagridview, and display the contents.
Code bit:
public partial class FormEditDbTable : Form
| |
by: Chris |
last post by:
I have a DataGridView in a form that will display the information from
various DataTables in my DataSet. The user is provided a list of
tables and when they select a table name, the DataGridView displays
the appropriate DataTable. When a user changes some of the settings
in my program, I sometimes have to recreate some of the DataTables,
however, the DataGridView will still somehow display the original
DataTable even if the DataGridView...
|
by: max |
last post by:
Dear Group,
I'm just learning Windows Forms and C# (just in time for it to be
replaced by MS What's Next) and have a question concerning displaying
columnar data in a single datagridview.
My data is stored as a collection of column objects , each of which
contains an array of values as well as datatype info. I want to
assemble an ordered group of these columns into a data table and use a
datagridview to manipulate it. Basically,...
|
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:
1) export to excel button exports the visible columns from the
datagridview to excel (this works fine)
|
by: jehugaleahsa |
last post by:
Hello:
I am binding a DataGridView with a BindingList<T>, where T is a custom
business object that implements INotifyPropertyChanged.
When you bind a DataGridView to a DataTable, it has this cool little
feature - it will not call DataTable.Rows.Add until after you leave
the DataGridView row. This is cool because it lets your user edit the
record as much as needed to get it into a valid state before actually
adding it to the DataTable.
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
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,...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |