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

disable filter

2 Answers 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
beeta one
Top achievements
Rank 1
beeta one asked on 28 Aug 2012, 06:02 AM
hii,
how to disable filter while editing?

thanks

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Aug 2012, 06:29 AM
Hello,

Try the following code.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
 if (e.Item is GridEditableItem && e.Item.IsInEditMode)
 {
   RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0].Visible = false;
 }
}

Thanks,
Princy.
0
Jayesh Goyani
Top achievements
Rank 2
answered on 28 Aug 2012, 06:36 AM
Hello,

please try with below code snippet.

protected void RadGrid3_PreRender(object sender, EventArgs e)
   {
       if (RadGrid3.EditItems.Count > 0)
       {
           GridFilteringItem item = RadGrid3.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
           (item["ID"].Controls[0] as TextBox).Enabled = false;
       }
 
   }
<telerik:RadGrid ID="RadGrid3" runat="server" AutoGenerateColumns="false" OnNeedDataSource="RadGrid3_NeedDataSource"
             AllowFilteringByColumn="true"
            onprerender="RadGrid3_PreRender">
            <MasterTableView CommandItemDisplay="Top">
                <Columns>
                    <telerik:GridBoundColumn HeaderText="ID" DataField="ID" UniqueName="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn>
                    </telerik:GridEditCommandColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
beeta one
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jayesh Goyani
Top achievements
Rank 2
Share this question
or