I have a webform grid as shown below. It has a search toolbar, custom paging and four columns (only the first column is made visible).
This grid need to be shown or hidden according to user selections. I use server side code "pnlDevIDList.Visible = true" and "pnlDevIDList.Visible= false" to show or hide the grid. The problem is, once the grid has been hidden, it lost all the settings when it is shown next time.
Attached are two photos for your reference. "1.png" is when the grid is shown for the first time, which is the expected appearance. "2.png" is when it has been hidden and shown again. As you can see, the toolbar and pager are missing. The 3 columns which should be invisible are also visible.
Any idea how to make it work? Thanks.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
<asp:Panel ID="pnlDevIDList" runat="server" >
<asp:HiddenField ID="SelectedRecordsConfig" runat="server" />
<div style = "position: absolute; top: 0px; left: 0px; width: 240px;">
<ejw:Grid GridLines="None" ID="lstDevicesConfig" runat="server" AllowPaging="true" AllowSelection="true" Selectiontype="Multiple" Height="190"
DataSourceCachingMode="Session">
<SelectionSettings SelectionMode="row"/>
<ToolbarSettings ShowToolbar="true" ToolbarItems="search"></ToolbarSettings>
<SearchSettings Fields="DeviceID" Operator="startsWith"/>
<ClientSideEvents ActionComplete="complete" />
<PageSettings ShowDefaults="false" PageSize="20" EnableTemplates="true" Template="#pagerTemplate" />
<Columns>
<ej:Column Field="DeviceID" HeaderText="Device ID" Width="100" AllowEditing="false"/>
<ej:Column Field="SatTypeCode" HeaderText="SatTypeCode" Width="50" AllowEditing="false" Visible="false"/>
<ej:Column Field="SpecialCode" HeaderText="SpecialCode" Width="50" AllowEditing="false" Visible="false"/>
<ej:Column Field="Expired" HeaderText="Expired" Width="50" AllowEditing="false" Visible="false"/>
</Columns>
</ejw:Grid>
</div>
</asp:Panel>
Attachment:
Pictures_739d72cf.rar