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

Enable/Disable Filter option in Radgrid detail table

1 Answer 251 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Anand
Top achievements
Rank 1
Anand asked on 27 Feb 2012, 01:43 PM
Hi All,
I am using radgrid Master-Detail table , having Show/Hide checkbox filter option on master table and its ruuning fine. Depending on Master show/hide checkbox status detail filter option works, but i want 2 diiferent show/hide checkboxs for master and detail radgid, in such a way that in detail table checkbox should come with each row and depending on checkstatus for perticular row checkbox filter option get displayed against each column.

Please help. Below is my code:

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" Width="995px" AutoGenerateColumns="False"

 

 

 

AllowMultiRowSelection="False" AllowPaging="true" PageSize="15" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"

 

 

 

Skin="Sunset" AllowCustomPaging="true" AllowFilteringByColumn="true" OnNeedDataSource="RadGrid1_NeedDataSource"

 

 

 

OnItemCreated="RadGrid1_ItemCreated" OnItemCommand="RadGrid1_ItemCommand" OnInit="RadGrid1_Init"

 

 

 

GroupingSettings-CaseSensitive="false">

 

 

 

<PagerStyle Mode="NumericPages" />

 

 

 

<MasterTableView TableLayout="Auto" AllowMultiColumnSorting="True" CellPadding="0"

 

 

 

DataKeyNames="TXNORDER" Width="100%" CommandItemDisplay="Top" GroupLoadMode="Server">

 

 

 

<CommandItemTemplate>

 

 

 

<asp:CheckBox ID="CheckBox2" AutoPostBack="true" CssClass="CheckBox" runat="server"

 

 

 

ForeColor="White" Text="Show Filter" />

 

 

 

</CommandItemTemplate>

 

 

 

<DetailTables>

 

 

 

<telerik:GridTableView DataKeyNames="TXNORDER" Name="Orders" Width="100%" AllowFilteringByColumn="true">

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn HeaderStyle-Width="5px" AllowFiltering="false">

 

 

 

<ItemTemplate>

 

 

 

<asp:ImageButton ID="imgCheck" runat="server" CausesValidation="false" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "CaptureImageKey")%>'

 

 

 

CommandName='<%# DataBinder.Eval(Container.DataItem, "ItemTypePK")%>' Height="20px"

 

 

 

ImageUrl="~/Images/check-template.png" OnClick="imgCheck_Click" ToolTip="Check Image"

 

 

 

Width="30px" />

 

 

 

</ItemTemplate>

 

 

 

<HeaderStyle Width="40px" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridNumericColumn DataField="TXNORDER" HeaderButtonType="TextButton" HeaderText="Transaction#"

 

 

 

SortExpression="TXNORDER" UniqueName="TXNORDER" Visible="False">

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridBoundColumn DataField="ItemTypePK" HeaderButtonType="TextButton" HeaderText="Type"

 

 

 

SortExpression="ItemTypePK" UniqueName="ItemTypePK">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD7" HeaderButtonType="TextButton" HeaderText="Serial#"

 

 

 

SortExpression="FIELD7" UniqueName="FIELD7">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD6" HeaderButtonType="TextButton" HeaderText="P44"

 

 

 

SortExpression="FIELD6" UniqueName="FIELD6">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD5" HeaderButtonType="TextButton" HeaderText="Routing#"

 

 

 

SortExpression="FIELD5" UniqueName="FIELD5">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="FIELD4" HeaderButtonType="TextButton" HeaderText="AltSerial#"

 

 

 

SortExpression="FIELD4" UniqueName="FIELD4">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridNumericColumn DataField="FIELD3" HeaderButtonType="TextButton" HeaderText="Account#"

 

 

 

SortExpression="FIELD3" UniqueName="FIELD3" FilterControlWidth="70px" DataType="System.Int32">

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridNumericColumn DataField="FIELD2" HeaderButtonType="TextButton" HeaderText="TC#"

 

 

 

SortExpression="FIELD2" UniqueName="FIELD2" FilterControlWidth="70px">

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridNumericColumn DataField="Amount" HeaderButtonType="TextButton" HeaderText="Amount"

 

 

 

SortExpression="Amount" UniqueName="Amount" HeaderStyle-HorizontalAlign="left"

 

 

 

ItemStyle-HorizontalAlign="left" FilterControlWidth="70px">

 

 

 

<HeaderStyle HorizontalAlign="Center" />

 

 

 

<ItemStyle CssClass="pad" HorizontalAlign="Right" />

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridBoundColumn DataField="CaptureImageKey" HeaderButtonType="TextButton"

 

 

 

HeaderText="CaptureImageKey" SortExpression="CaptureImageKey" UniqueName="CaptureImageKey"

 

 

 

Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="EnterpriseID" HeaderButtonType="TextButton" HeaderText="EnterpriseID"

 

 

 

SortExpression="EnterpriseID" UniqueName="EnterpriseID" Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ReverseReason" HeaderButtonType="TextButton"

 

 

 

HeaderText="ReverseReason" SortExpression="ReverseReason" UniqueName="ReverseReason"

 

 

 

Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</telerik:GridTableView>

 

 

 

</DetailTables>

 

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn HeaderStyle-Width="5px" AllowFiltering="false">

 

 

 

<ItemTemplate>

 

 

 

<asp:ImageButton ID="imgReverseTransaction" runat="server" CausesValidation="false"

 

 

 

Height="20px" Width="20px" CommandArgument='<%#Eval("TXNORDER") + ","+Eval("EnterpriseID")+ ","+Eval("BankID")+ ","+Eval("BranchID")+ ","+Eval("BatchID")+ ","+Eval("OPENEDTIME") + ","+Eval("SourceTypePK")+ ","+Eval("AuxBatchID")%>'

 

 

 

CommandName="ReverseTransaction" ImageUrl="~/Images/undo.png" OnClick="imgReverseTransaction_Click"

 

 

 

OnClientClick="javascript:return confirm('Are you sure you want to reverse this transaction? \n This action cannot be undone.')"

 

 

 

ToolTip="Reverse Transaction" Visible='<%#DataBinder.Eval(Container.DataItem,"ShowImgReverseTransaction")%>' />

 

 

 

</ItemTemplate>

 

 

 

<HeaderStyle Width="30px" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridNumericColumn DataField="TXNORDER" HeaderButtonType="TextButton" HeaderText="Transaction #"

 

 

 

SortExpression="TXNORDER" FilterControlWidth="70px" UniqueName="TXNORDER" DataType="System.Int16">

 

 

 

<ItemStyle CssClass="pad" HorizontalAlign="left" />

 

 

 

</telerik:GridNumericColumn>

 

 

 

<telerik:GridBoundColumn DataField="CaptureStatus" HeaderButtonType="TextButton"

 

 

 

HeaderText="Capture Status" SortExpression="CaptureStatus" DataType="System.String"

 

 

 

AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" >

 

 

 

<HeaderStyle HorizontalAlign="left" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="TRANSACTIONTIME" HeaderButtonType="TextButton"

 

 

 

HeaderText="Transaction Time" SortExpression="TRANSACTIONTIME" DataType="System.DateTime">

 

 

 

<HeaderStyle HorizontalAlign="Center" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridNumericColumn DataField="Amount" HeaderButtonType="TextButton" HeaderText="Amount"

 

 

 

SortExpression="Amount" UniqueName="Amount" FilterControlWidth="70px" HeaderStyle-HorizontalAlign="left"

 

 

 

ItemStyle-HorizontalAlign="left" DataType="System.Decimal">

 

 

 

<HeaderStyle HorizontalAlign="Center" />

 

 

 

<ItemStyle CssClass="pad" HorizontalAlign="left" />

 

 

 

</telerik:GridNumericColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings>

 

 

 

<Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True"

 

 

 

SaveScrollPosition="True"></Scrolling>

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

 

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 01 Mar 2012, 01:49 PM
Hello,

I am not sure that I understand correctly your requirement. If you want to hide the FilterMenu of the detail table you need to hook the CheckedChange event of the second CheckBox control. In its body you need to set the IsFilterItemExpanded property of the detail table.

If this is not the case, please elaborate a bit more on your requirement.

Regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Filter
Asked by
Anand
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or