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

Datagridview InsertAt

I have 2 column :
Column1 Column2
A 25
B 20
C 15
D 10
E 5

After i load form, i move current cell to D and my currentcell.rowindex is 4
grid.CurrentCell.RowIndex = 4
Then i sort by clicking column2 . And my currentcell.rowindex is 2.
I add a row by using insertat function :

DataSet ds = (DataSet)grid.DataSource;
DataTable dt = ds.Tables[0];

DataRow row = dt.NewRow();
row["ID"] = System.Guid.NewGuid().ToString().ToUpper();
dt.Rows.InsertAt(row, base.CurrentCell.RowIndex + 1);

But due to sort order this row goes to first row.
I don 't want this. I want that empty cell to locate 3 'rd row.
How can i customize that sort and implement this feature ?

Jan 13 '06 #1
0 2313

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

Similar topics

1
by: Derrick | last post by:
Hi all, I've been trying to understand exactly how to insert a newly created DataRow into a DataRowCollection at a specified row value without much luck. At first I was just appending the...
0
by: Dave Elliott | last post by:
After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is after the newly added row without getting bizarre results. I have added the...
5
by: Dave | last post by:
I tried posting this in the WinForm forum and got no hits so I am trying it here. After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row...
3
by: Kelvin | last post by:
Hi All, I have some question about inserting new row into datatable. I don't know why my all new rows inserted into end of datatable. I am using myTable.Rows.InsertAt(dr, 0); I don't know...
0
by: Kelvin | last post by:
Hi All, I don't why I can't insert new rows between rows, and it can append on buttom record of datatable. With reference my code, Using Rows.InserAt or Rows.Add() is the better. Please advise....
1
by: dx | last post by:
Any ideas? I can't find any examples that support this. I'm thinking a solution may be something like inherting arraylist and containing a hashtable. or Inheriting NameObjectCollectionBase...
2
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 -...
1
by: inpuarg | last post by:
Is it possible to disable sort temporarilty ? without changing current row ? I want to add a row to a specific location. But if user sorted the datagridview row goes to a wrong position. That 's...
3
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.