Hello to all
i m binding a radgrid on page load initially radgrid's visibility is false on the selection change of dropdown i want to filter datafrom radgrid my code is here but its not work.....
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
RadGrid1.Visible = true;
RadGrid1.MasterTableView.FilterExpression = "([totaldis] ='" + DropDownList1.SelectedValue + "=') ";
GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("totaldis");
column.CurrentFilterFunction = GridKnownFunction.EqualTo;
column.CurrentFilterValue = DropDownList1.SelectedValue;
RadGrid1.MasterTableView.Rebind();
}
radgrid property is
<telerik:RadGrid Skin="Sunset" OnPreRender="RadGrid1_PreRender" Width="1200px" ID="RadGrid1"
AutoGenerateColumns="False" EnableLinqExpressions="false" OnNeedDataSource="RadGrid1_NeedDataSource" AllowMultiRowSelection="true" GridLines="None" runat="server"
ShowFooter="True" AllowPaging="false" AllowFilteringByColumn="True" Visible="False">
<ClientSettings AllowColumnsReorder="true" EnableRowHoverStyle="true" ReorderColumnsOnClient="true"
Selecting-AllowRowSelect="True">
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView AllowFilteringByColumn="True">
<RowIndicatorColumn Visible="True">
</RowIndicatorColumn>
<Columns>
<telerik:GridBoundColumn HeaderStyle-Width="20px" ItemStyle-Width="20px" HeaderText="Total Income"
DataField="tolincome">
<HeaderStyle Width="20px"></HeaderStyle>
<ItemStyle Width="20px"></ItemStyle>
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
i m binding a radgrid on page load initially radgrid's visibility is false on the selection change of dropdown i want to filter datafrom radgrid my code is here but its not work.....
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
RadGrid1.Visible = true;
RadGrid1.MasterTableView.FilterExpression = "([totaldis] ='" + DropDownList1.SelectedValue + "=') ";
GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("totaldis");
column.CurrentFilterFunction = GridKnownFunction.EqualTo;
column.CurrentFilterValue = DropDownList1.SelectedValue;
RadGrid1.MasterTableView.Rebind();
}
radgrid property is
<telerik:RadGrid Skin="Sunset" OnPreRender="RadGrid1_PreRender" Width="1200px" ID="RadGrid1"
AutoGenerateColumns="False" EnableLinqExpressions="false" OnNeedDataSource="RadGrid1_NeedDataSource" AllowMultiRowSelection="true" GridLines="None" runat="server"
ShowFooter="True" AllowPaging="false" AllowFilteringByColumn="True" Visible="False">
<ClientSettings AllowColumnsReorder="true" EnableRowHoverStyle="true" ReorderColumnsOnClient="true"
Selecting-AllowRowSelect="True">
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView AllowFilteringByColumn="True">
<RowIndicatorColumn Visible="True">
</RowIndicatorColumn>
<Columns>
<telerik:GridBoundColumn HeaderStyle-Width="20px" ItemStyle-Width="20px" HeaderText="Total Income"
DataField="tolincome">
<HeaderStyle Width="20px"></HeaderStyle>
<ItemStyle Width="20px"></ItemStyle>
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>