We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid selected row

Thread ID:

Created:

Updated:

Platform:

Replies:

29627 May 30,2005 08:23 PM UTC Jun 29,2005 09:17 AM UTC Windows Forms 8
loading
Tags: GridControl
Martin Cyr
Asked On May 30, 2005 08:23 PM UTC

Is there any way to find out the currently selected DataRow/DataRowView in the gdbg?

Administrator [Syncfusion]
Replied On May 30, 2005 08:44 PM UTC

Try this code. CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager; DataRowView drv = cm.Current as DataRowView;

Martin Cyr
Replied On May 31, 2005 01:02 PM UTC

Great!!!! Thanks for info. Can''t tell you how satisfied I am with SyncFusion support :) Keep on truckin'' >Try this code. > >CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager; >DataRowView drv = cm.Current as DataRowView; >

Martin Cyr
Replied On May 31, 2005 01:45 PM UTC

Little followup now. Can I get the next/previous row without moving the cursor? >Great!!!! Thanks for info. > >Can''t tell you how satisfied I am with SyncFusion support :) > >Keep on truckin'' > >>Try this code. >> >>CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager; >>DataRowView drv = cm.Current as DataRowView; >>

Administrator [Syncfusion]
Replied On May 31, 2005 01:52 PM UTC

The cm.List will be the DataView, and you can index it to get at any of the DataRowView objects (though you will have to make sure the indexes are proper values which the code below does not worry about). CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager; DataView dv = cm.List as DataView DataRowView nextDrv = dv[cm.Position + 1];

Martin Cyr
Replied On May 31, 2005 02:47 PM UTC

I just ran in another problem when trying to use the information you provided in http://www.syncfusion.com/Support/forums/message.aspx?MessageID=29524. If I understand correctly, I could color a precise cell/row/col at this moment, but I need something slightly more fancy. I need to choose the color according to a value in the corresponding DataRow/View, but the currency manager doesn\''t seem to be synchronized. Still I could access the cell containing the color wich I wanna use, but obviously, this is a no-no since I don\''t want to show this column to the user. Any ideas?

Administrator [Syncfusion]
Replied On May 31, 2005 03:03 PM UTC

Use the cm.List and retrieve the DataRowView within PrepareViewStyleInfo so you can test the value you want to test. See the response in 29524.

Sharad Sharma
Replied On June 29, 2005 09:05 AM UTC

Can we drag and drop this selected row(s) within the GridDataBoundGrid. Thanks. >Try this code. > >CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager; >DataRowView drv = cm.Current as DataRowView; >

Administrator [Syncfusion]
Replied On June 29, 2005 09:17 AM UTC

If you are using a DataTable/DataView as the DataSource of the GridDataBoundGrid, then you will not be able to easily move rows. The reason is that a sorted dataview will not let you change row-order as it actively maintains teh proper sort order. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=31033

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;