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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Search value in column and select row

Thread ID:

Created:

Updated:

Platform:

Replies:

141121 Nov 25,2018 03:24 PM UTC Nov 26,2018 01:11 PM UTC WinForms 1
loading
Tags: GridGroupingControl
Thomas
Asked On November 25, 2018 03:24 PM UTC

Hello,

I hope you can help me - I have not found a solution.
In a grid grouping control I have bound my database. Is it possible to search in a column (for example the ID) a value and when I found it show the position and select the whole row?

The reason is, when i make a doubleclick on a row a second windows opens to make changes. When I click save the windows close and the GGC is reloading (more user work on the database) the data from the database. The GGC shows the list on the top but user would like to see the last edited row.

Thanks for your support.
Thomas

Mohanraj Gunasekaran [Syncfusion]
Replied On November 26, 2018 01:11 PM UTC

Hi Thomas, 
 
Thanks for using Syncfusion product. 
 
To find the cell value based on the column name, you could use the Record row index using GetRowIndex method and select that record using SetSelected method in QueryCellStyleInfo event. Please refer the following code example, 
 
Code example 
this.gridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo; 
 
int rowIndex = -1; 
private void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) 
{ 
    if (e.TableCellIdentity == null || e.TableCellIdentity.Column == null) 
        return; 
             
    if (e.TableCellIdentity.DisplayElement.Kind == Syncfusion.Grouping.DisplayElementKind.Record) 
    { 
        var record = e.TableCellIdentity.DisplayElement.GetRecord(); 
        if (e.TableCellIdentity.Column.Name == "Id" && record.GetValue("Id").ToString().Equals("E20")) 
        { 
            rowIndex = e.TableCellIdentity.DisplayElement.GetRowIndex(); 
        } 
 
        if (!record.IsSelected() && record.GetRowIndex() == rowIndex) 
        { 
            record.SetSelected(true); 
        } 
    } 
} 
 
 
Regards, 
Mohanraj G 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

;