Hi
I have a RadGrid on my aspx page with no columns defined as follows:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="True" Skin="Metro"
GroupingEnabled="true" ShowGroupPanel="True" GridLines="None" EnableLinqExpressions="false">
<ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
<Excel Format="ExcelML" />
</ExportSettings>
<MasterTableView TableLayout="Fixed" AutoGenerateColumns="true" Width="100%" CommandItemDisplay="Top"
AllowMultiColumnSorting="True" GroupLoadMode="Server" ShowGroupFooter="true"
AllowSorting="True" AllowPaging="True" PageSize="20" ShowFooter="false" HeaderStyle-HorizontalAlign="left"
FooterStyle-HorizontalAlign="Right" EnableHeaderContextMenu="true" EnableHeaderContextAggregatesMenu="true"
AllowFilteringByColumn="True" HeaderStyle-BackColor="Black" HeaderStyle-ForeColor="White">
<CommandItemSettings ShowExportToExcelButton="true" />
<NoRecordsTemplate>
<div class="NoRecordsTemplate">
No records to view</div>
</NoRecordsTemplate>
</MasterTableView>
<ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true" AllowColumnsReorder="true"
ReorderColumnsOnClient="true">
<Selecting AllowRowSelect="True"></Selecting>
<Resizing AllowResizeToFit="true" AllowColumnResize="True" EnableRealTimeResize="True">
</Resizing>
</ClientSettings>
<GroupingSettings CaseSensitive="false" ShowUnGroupButton="True" RetainGroupFootersVisibility="true" />
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
</telerik:RadGrid>
On my code-behind page I populate the RadGrid using the GetDataTable function as follows:
Public Function GetDataTable(ByVal query As String) As DataTable
Dim ConnString As String = ConfigurationManager.ConnectionStrings("SQLConn").ConnectionString
Dim conn As SqlConnection = New SqlConnection(ConnString)
Dim adapter As SqlDataAdapter = New SqlDataAdapter
adapter.SelectCommand = New SqlCommand(query, conn)
Dim table1 As New DataTable
conn.Open()
Try
adapter.Fill(table1)
Finally
conn.Close()
End Try
Return table1
End Function
What I am trying to do is hide the filter icon, set AutoPostBackOnFilter=True and set filter width to auto fit programmatically.
I was able to hide the filter icon by using the following:
<style>
.RadGrid .rgFilter
{
display: none;
}
</style>
However, I can't figure how to set AutoPostBackOnFilter=True and set filter width to auto fit programmatically.
How can I accomplish this?
Thanks,
Sigi Perez
I have a RadGrid on my aspx page with no columns defined as follows:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="True" Skin="Metro"
GroupingEnabled="true" ShowGroupPanel="True" GridLines="None" EnableLinqExpressions="false">
<ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
<Excel Format="ExcelML" />
</ExportSettings>
<MasterTableView TableLayout="Fixed" AutoGenerateColumns="true" Width="100%" CommandItemDisplay="Top"
AllowMultiColumnSorting="True" GroupLoadMode="Server" ShowGroupFooter="true"
AllowSorting="True" AllowPaging="True" PageSize="20" ShowFooter="false" HeaderStyle-HorizontalAlign="left"
FooterStyle-HorizontalAlign="Right" EnableHeaderContextMenu="true" EnableHeaderContextAggregatesMenu="true"
AllowFilteringByColumn="True" HeaderStyle-BackColor="Black" HeaderStyle-ForeColor="White">
<CommandItemSettings ShowExportToExcelButton="true" />
<NoRecordsTemplate>
<div class="NoRecordsTemplate">
No records to view</div>
</NoRecordsTemplate>
</MasterTableView>
<ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true" AllowColumnsReorder="true"
ReorderColumnsOnClient="true">
<Selecting AllowRowSelect="True"></Selecting>
<Resizing AllowResizeToFit="true" AllowColumnResize="True" EnableRealTimeResize="True">
</Resizing>
</ClientSettings>
<GroupingSettings CaseSensitive="false" ShowUnGroupButton="True" RetainGroupFootersVisibility="true" />
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
</telerik:RadGrid>
On my code-behind page I populate the RadGrid using the GetDataTable function as follows:
Public Function GetDataTable(ByVal query As String) As DataTable
Dim ConnString As String = ConfigurationManager.ConnectionStrings("SQLConn").ConnectionString
Dim conn As SqlConnection = New SqlConnection(ConnString)
Dim adapter As SqlDataAdapter = New SqlDataAdapter
adapter.SelectCommand = New SqlCommand(query, conn)
Dim table1 As New DataTable
conn.Open()
Try
adapter.Fill(table1)
Finally
conn.Close()
End Try
Return table1
End Function
What I am trying to do is hide the filter icon, set AutoPostBackOnFilter=True and set filter width to auto fit programmatically.
I was able to hide the filter icon by using the following:
<style>
.RadGrid .rgFilter
{
display: none;
}
</style>
However, I can't figure how to set AutoPostBackOnFilter=True and set filter width to auto fit programmatically.
How can I accomplish this?
Thanks,
Sigi Perez