473,511 Members | 16,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in selecting row after sorting in datagrid...

Hi All

I have one specific question for DataGrid

In the Form Load event of the Form, I am binding data with DataGrid.

On clicking Row the CurrentRowIndex is updated and it gives me correct
rowindex.

But if, I click on Column the data gets sorted in ascending or
descending order. But with that currentrowindex is not updated. It
remains the same as the one when it was during the original data binding.

So, on clicking the row it does not return me the right now. It seems
the datagried is view is sorted but rowindex is not updated.

How can refresh the datagrid and can always get the right row evern
after sorting

~ Regards

Silent Ocean
Sep 22 '05 #1
1 1412
Deep,

Don't use the rows from the datagrid, try to use the rows from the
datatable.defaultview

I hope this helps,

Cor

"Deep Silent Ocean" <oc**********@gmail.com> schreef in bericht
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi All

I have one specific question for DataGrid

In the Form Load event of the Form, I am binding data with DataGrid.

On clicking Row the CurrentRowIndex is updated and it gives me correct
rowindex.

But if, I click on Column the data gets sorted in ascending or descending
order. But with that currentrowindex is not updated. It remains the same
as the one when it was during the original data binding.

So, on clicking the row it does not return me the right now. It seems the
datagried is view is sorted but rowindex is not updated.

How can refresh the datagrid and can always get the right row evern after
sorting

~ Regards

Silent Ocean

Sep 23 '05 #2

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

Similar topics

6
13564
by: aaa | last post by:
Hi I am trying to create a read-only DataGrid that would always have current row selected. Currently, I am using method: public void SelectDataGridRow(DataGrid dg) { if (dg.CurrentRowIndex >...
2
3149
by: Hajime Kusakabe | last post by:
Hi. I have created a datagrid (datagrid1) without any columns on a aspx page. Then aspx.vb adds columns from a database. It is somthing like this .... ================================== Dim...
1
1168
by: bredal Jensen | last post by:
Hello, I'am experiencing that Asp.net can not handle sorting of datagrid when the number of items exceed a few thousands. Is anyone aware of this problem? The sorting works fine when the number...
1
299
by: Deep Silent Ocean | last post by:
Hi All I have one specific question for DataGrid In the Form Load event of the Form, I am binding data with DataGrid. On clicking Row the CurrentRowIndex is updated and it gives me correct...
8
15140
by: simchajoy2000 | last post by:
I thought the only thing I had to do to disable column sorting in VB.NET was to set datagrid.AllowSorting = False. Unfortunately this has never worked for me. I discovered another set of code...
3
1452
by: Gidi | last post by:
Hi, I've a dataGrid, and When I click with the mouse on one of it's header the DataGrid_Click event is called. I don't have problem with the event, but strange things happen to the dataGrid...
1
3075
by: Mark Gilkes | last post by:
I have a DataGrid which I am adding to the page dynamically at the Init stage of the page load. The DataGrid has AutoGenerateColumns turned off, has BoundColumns and is bound to a DataView for...
0
2057
by: rupalirane07 | last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error: NullReferenceException error Any...
1
2165
by: Ahmed Yasser | last post by:
Hi all, i have a problem with the datagridview sorting, the problem is a bit complicated so i hope i can describe in the following steps: 1. i have a datagridview with two columns...
0
7242
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
7423
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...
0
5668
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,...
0
4737
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...
0
3225
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...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
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 ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
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...

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.