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

Change color of filtertextbox

5 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
t
Top achievements
Rank 1
t asked on 22 Jul 2008, 09:24 AM
Hi,

is it possible to change the color of the filtertextbox if any filter is applied?

I can't find any solution to this.

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Jul 2008, 10:46 AM
Hi t,

Give a try with the following code snippet and see if it helps.

CS:
 string strArg = ""
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "Filter") 
        { 
             strArg = ((System.Web.UI.Pair)(e.CommandArgument)).Second.ToString(); 
 
        } 
    } 
 
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridFilteringItem) 
        { 
            if (strArg != string.Empty) 
            { 
                GridFilteringItem filter = (GridFilteringItem)e.Item; 
                TextBox txtbx = (TextBox)filter[strArg].Controls[0]; 
                txtbx.BackColor = System.Drawing.Color.Red; 
            } 
        } 
    } 


Thanks
Shinu.
0
t
Top achievements
Rank 1
answered on 22 Jul 2008, 11:00 AM
i
0
t
Top achievements
Rank 1
answered on 22 Jul 2008, 11:01 AM
It works.
Thank you.
0
Srikanth
Top achievements
Rank 1
answered on 08 Sep 2008, 11:23 PM
Hi Shinu,

I'm looking for the exact feature and couldn't get it to work. Any suggestions please...
0
Srikanth
Top achievements
Rank 1
answered on 09 Sep 2008, 03:57 PM
hi,

I got it to work finally but the color remains same even after applying no filter. Can you please let me know how to capture the "NoFilter" event ?

regards,
Srikanth
Tags
Grid
Asked by
t
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
t
Top achievements
Rank 1
Srikanth
Top achievements
Rank 1
Share this question
or