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

[Solved] Emptymessage on filter textbox?

2 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AereoN
Top achievements
Rank 1
AereoN asked on 19 Nov 2009, 07:54 AM
Is there anyway for me to set emptymessage on the filter textbox?
Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 19 Nov 2009, 09:29 AM
Hi,

You can try out the following code to achieve the required. Alter the logic according to your requirement:
c#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridFilteringItem) 
        { 
            GridFilteringItem filter = (GridFilteringItem)e.Item; 
            foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns) 
            { 
 
                if (col.OrderIndex > 1 && col.ColumnType == "GridBoundColumn"
                { 
                    TextBox txtbx = filter[col.UniqueName].Controls[0] as TextBox; 
                    if(txtbx.Text == ""
                         txtbx.Text = "Filter text";                     
                } 
            } 
        } 
    }     

Thanks
Princy.
0
AereoN
Top achievements
Rank 1
answered on 19 Nov 2009, 09:40 AM
EDIT: Got it working already.
Thanks a lot.
Tags
Grid
Asked by
AereoN
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
AereoN
Top achievements
Rank 1
Share this question
or