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

extract text in the filter textbox

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 30 Oct 2012, 11:23 AM
Hi

In my radgrid I have enabled filtering of columns. I want to extract the text typed in the filter textbox in itemcommand event. How should I access the text.
thanks in advance
savyo

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Oct 2012, 11:25 AM
Hi,

Please try the following code to access the Filter TextBox in ItemCommand event.

C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
        {
            GridFilteringItem fitem = (GridFilteringItem)e.Item;
            TextBox filterBox = (TextBox)fitem["ColumnUniqueName"].Controls[0];
            string strTxt = filterBox.Text;
        }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Savyo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or