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.

How to get the selected row from a grid control

Thread ID:

Created:

Updated:

Platform:

Replies:

36869 Nov 11,2005 06:40 AM Nov 11,2005 08:32 AM Windows Forms 2
loading
Tags: GridControl
Ravi Kumar
Asked On November 11, 2005 06:40 AM

I just went thru the code snippet where from u can extract the selected row from a databound grid! will the same work for Grid control and Grid control base? Plz respond back quickly! Its very urgent! We have been struck up here

Administrator [Syncfusion]
Replied On November 11, 2005 08:30 AM

You can try this code snippet to get the selected current row: this.gridControl1.SelectionChanged += new Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventHandler(this.gridControl1_SelectionChanged); private void gridControl1_SelectionChanged(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventArgs e) { //For GridControl Console.WriteLine("Row {0} selected in GridControl",this.gridControl1.Selections.Ranges.ActiveRange.Top); } this.gridDataBoundGrid1.Model.SelectionChanged+=new GridSelectionChangedEventHandler(Model_SelectionChanged); private void Model_SelectionChanged(object sender, GridSelectionChangedEventArgs e) { //For GridDataBoundGrid Console.WriteLine("Row {0} selected in GridDataBoundGrid",this.gridDataBoundGrid1.Selections.Ranges.ActiveRange.Top); } Let us know if this helps. Best Regards, Jeba.

Administrator [Syncfusion]
Replied On November 11, 2005 08:32 AM

You can try this code snippet to get the selected current row: this.gridControl1.SelectionChanged += new Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventHandler(this.gridControl1_SelectionChanged); private void gridControl1_SelectionChanged(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventArgs e) { //For GridControl Console.WriteLine("Row {0} selected in GridControl",this.gridControl1.Selections.Ranges.ActiveRange.Top); } this.gridDataBoundGrid1.Model.SelectionChanged+=new GridSelectionChangedEventHandler(Model_SelectionChanged); private void Model_SelectionChanged(object sender, GridSelectionChangedEventArgs e) { //For GridDataBoundGrid Console.WriteLine("Row {0} selected in GridDataBoundGrid",this.gridDataBoundGrid1.Selections.Ranges.ActiveRange.Top); } Let us know if this helps. Best Regards, Jeba.

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.

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.

;