This is a migrated thread and some comments may be shown as answers.

SearchRow event

1 Answer 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason Parrish
Top achievements
Rank 1
Jason Parrish asked on 20 Jan 2017, 03:43 PM

I have a toggle button that shows/hides the search row.  However, I need to capture the close event of the search row so I can change the toggle button state. This is needed because the user can click the X to close the search row.  Or, can I hide the X button?

Thanks!

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 Jan 2017, 11:56 AM
Hi Jason,

Thank you for writing.

To determine when the search row is hidden/shown you should use the PropertyChanged event. The following example shows how you can use this event. It shows how you can hide the close button as well:
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    var searchRow = radGridView1.MasterView.TableSearchRow as GridViewSearchRowInfo;
    searchRow.PropertyChanged += SearchRow_PropertyChanged;
    searchRow.ShowCloseButton = false;
}
  
private void SearchRow_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    if (e.PropertyName == "IsVisible")
    {
  
    }
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Jason Parrish
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or