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

Set GridBoundColumn filter textbox tooltip/label for?

2 Answers 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 2
Iron
Iron
Veteran
Jay asked on 27 Dec 2013, 03:38 PM
I need to provide accessibility cues for the textbox of the standard column filter. It looks like I could do this using a FilterTemplate which has a hidden asp:Label with its AssociatedControlId set to an asp:TextBox. However, I would then have to implement all the filtering myself rather than using what the grid provides.

Is there a way to associate a tool tip or something with the textbox provided by the standard filter? Can I somehow access the standard filter's text box?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 30 Dec 2013, 08:01 AM
Hello Jay,

You can get reference to the TextBox control associated with the filter for a given column by handling the server-side ItemCreated event of the grid. The code snippet bellow demonstrates how to get reference to the TextBox for the column with UniqueName "FirstName" (as an example):
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridFilteringItem)
    {
        GridFilteringItem item = e.Item as GridFilteringItem;
        TextBox firstNameFilterTextBox = item["FirstName"].Controls[0] as TextBox;
        firstNameFilterTextBox.ToolTip = "changed tool tip";
    }
}

Hope that helps.


Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Jay
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 30 Dec 2013, 03:33 PM
Thanks, that worked!
Tags
Grid
Asked by
Jay
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Konstantin Dikov
Telerik team
Jay
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or