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

Column Title with Checklist Filtering

2 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sonny
Top achievements
Rank 1
Sonny asked on 08 Aug 2014, 09:16 PM
Hello,

My customers would like to combine the column titles with checklist filtering. They would like to eliminate the textbox and display only the checklist button next to the column title as shown in the attached image. I realize that Radgrid does not have any built in ability to do this, but is there a way to customize it using code behind and/or client side scripting? If so, can you provide, or point me to an existing example?

Thanks,
~Sonny

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Aug 2014, 06:10 AM
Hi Sonny,

You can try hiding the FilterTextBox and add a label displaying the column title as shown below:

C#:
protected void rgrdSample_ItemCreated(object sender, GridItemEventArgs e)
{
    GridFilteringItem filteringItem = e.Item as GridFilteringItem;
    foreach (GridColumn col in rgrdSample.MasterTableView.Columns)
    {
        if (e.Item is GridFilteringItem)
        {
            Label lblTitle = new Label();
            lblTitle.ID = "lblTitle" + col.UniqueName;
            lblTitle.Text = col.HeaderText;
            TextBox filterbox = filteringItem[col.UniqueName].Controls[0] as TextBox;
            filterbox .Visible = false;
            filteringItem[col.UniqueName].Controls.AddAt(0, lblTitle);
        }
    }
}

Thanks,
Shinu
0
Sonny
Top achievements
Rank 1
answered on 11 Aug 2014, 06:23 PM
Your solution works great! Thanks Shinu!
Tags
Grid
Asked by
Sonny
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Sonny
Top achievements
Rank 1
Share this question
or