This is kind of funny because any single example I have seen on your site and any others RadGrid I used it was working but in one my case flipping pages kills the filters. It looks like nothing has to be done to preserve filters when pages changes, so I wonder why it does not work with my particular grid.
It is 2009, Q1 Radgrid, with standard NextPrevNumericAndAdvanced mode paging. It fed by non-cashable DataReader. The grid does NOT use Ajax and each repost sucks fresh data.
The filtering works fine, so the paging. However, the PageIndexChanged even does not fire. I thought to run in PageIndexChanged event across the columns, cash the CurrentFilterValues and then reset the Values in PreRender event but no luck for now. What is particularly interesting is that in your demo Grids you do NOT it and your filters/pages work very consistency with no extra coding efforts. Am I missing anything?
Rgs, Romy
I’m trying to figure out how to reduce the padding or margin for the filter cells inside the grid. I’m using the latest Grid-Ajax release.
I thought that this would do it:
<FilterItemStyle CssClass="GridFilterStyle" />
With the CSS class:
.GridFilterStyle
{
padding: 0px;
margin: 0px;
}
But that did not do it. So I spent the last few hours reading the skins blog and how to customize the new skins, so I thought this would work:
td.rgFilterRow_WebBlue
{
padding: 0px;
margin: 0px;
}
or
tr.rgFilterRow_WebBlue
{
padding: 0px;
margin: 0px;
}
But that did not do it. Help please.
thanks,
-sam
<telerik:AjaxSetting AjaxControlID="btnSubmit">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />
<telerik:AjaxUpdatedControl ControlID="pnlResults" />
</UpdatedControls>
</telerik:AjaxSetting>
| grdManifest.MasterTableView.GetColumn("ViewErrorDescription").Display = false; |
| tableView = grdManifest.get_masterTableView(); |
| tableView.showColumn(tableView.getColumnByUniqueName("ViewErrorDescription").get_element().cellIndex); |
| tableView.hideColumn(tableView.getColumnByUniqueName("CustomerImported").get_element().cellIndex); |
| tableView.hideColumn(tableView.getColumnByUniqueName("RollsReceived").get_element().cellIndex); |
| tableView.hideColumn(tableView.getColumnByUniqueName("ViewReceiptErrors").get_element().cellIndex); |
| tableView.hideColumn(tableView.getColumnByUniqueName("ViewTransactionHistory").get_element().cellIndex); |
| <telerik:RadGrid ID="grdManifest" runat="server" AllowFilteringByColumn="false" AllowSorting="true" |
| AllowPaging="true" PageSize="13" EnableViewState="false" AutoGenerateColumns="false" |
| style="display:none; overflow:hidden;"> |
| <MasterTableView ClientDataKeyNames="ManifestID, SupplierCode, SoldToCodeType, SoldToCode, CorporateCode, PrintSiteCode" |
| ShowHeader="true"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="ManifestID" Visible="false" DataType="System.Int32" |
| UniqueName="ManifestID" /> |
| <telerik:GridBoundColumn DataField="ManifestNumber" HeaderText="Manifest Number" |
| DataType="System.String" DataFormatString="<nobr>{0}</nobr>" HeaderStyle-Width="95px" |
| ItemStyle-Width="95px" /> |
| <telerik:GridBoundColumn DataField="BillOfLading" HeaderText="BOL" DataType="System.String" |
| DataFormatString="<nobr>{0}</nobr>" UniqueName="BillOfLading" HeaderStyle-Width="90px" |
| ItemStyle-Width="90px" /> |
| <telerik:GridBoundColumn DataField="SupplierCode" Visible="false" DataType="System.String" /> |
| <telerik:GridBoundColumn DataField="SoldToCodeType" Visible="false" DataType="System.String" /> |
| <telerik:GridBoundColumn DataField="SoldToCode" Visible="false" DataType="System.String" /> |
| <telerik:GridButtonColumn HeaderText="Sold To" ButtonType="LinkButton" CommandName="ViewSoldTo" |
| DataTextField="SoldTo" DataTextFormatString="<nobr>{0}</nobr>" UniqueName="ViewSoldTo" |
| HeaderStyle-Width="150px" ItemStyle-Width="150px" SortExpression="SoldTo"> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="CorporateCode" Visible="false" DataType="System.String" /> |
| <telerik:GridBoundColumn DataField="PrintSiteCode" Visible="false" DataType="System.String" /> |
| <telerik:GridButtonColumn HeaderText="Print Site" ButtonType="LinkButton" CommandName="ViewPrintSite" |
| DataTextField="PSName" DataTextFormatString="<nobr>{0}</nobr>" UniqueName="ViewPrintSite" |
| HeaderStyle-Width="150px" ItemStyle-Width="150px" SortExpression="PrintSite"> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="ShipDate" HeaderText="Ship Date" DataType="System.DateTime" |
| DataFormatString="{0:MM/dd/yyyy}" UniqueName="ShipDate" HeaderStyle-Width="70px" |
| ItemStyle-Width="70px" /> |
| <telerik:GridBoundColumn DataField="ImportDate" HeaderText="Import Date" DataType="System.DateTime" |
| DataFormatString="{0:MM/dd/yyyy}" HeaderStyle-Width="70px" ItemStyle-Width="70px" /> |
| <telerik:GridBoundColumn DataField="MessageType" HeaderText="Message Type" DataType="System.String" |
| HeaderStyle-Width="60px" ItemStyle-Width="60px" /> |
| <telerik:GridButtonColumn HeaderText="Total Items" ButtonType="LinkButton" CommandName="ViewItems" |
| DataTextField="TotalItems" DataTextFormatString="{0}" UniqueName="ViewItems" |
| HeaderStyle-Width="30px" ItemStyle-Width="30px" SortExpression="TotalItems"> |
| </telerik:GridButtonColumn> |
| <telerik:GridButtonColumn HeaderText="Total Rolls" ButtonType="LinkButton" CommandName="ViewRolls" |
| DataTextField="TotalRolls" DataTextFormatString="{0}" UniqueName="ViewRolls" |
| HeaderStyle-Width="30px" ItemStyle-Width="30px" SortExpression="TotalRolls"> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="TotalGrossWeight" HeaderText="Total Gross Weight" |
| DataType="System.Decimal" DataFormatString="{0:N}" HeaderStyle-Width="75px" ItemStyle-Width="75px" /> |
| <telerik:GridBoundColumn DataField="CustomerImported" HeaderText="Customer Imported" |
| DataType="System.String" HeaderStyle-Width="70px" ItemStyle-Width="70px" UniqueName="CustomerImported"/> |
| <telerik:GridBoundColumn DataField="RollsReceived" HeaderText="Rolls Received" DataType="System.Int32" |
| HeaderStyle-Width="55px" ItemStyle-Width="55px" /> |
| <telerik:GridButtonColumn HeaderText="Receipt Errors" ButtonType="LinkButton" CommandName="ViewReceiptErrors" |
| DataTextField="ReceiptErrors" DataTextFormatString="<nobr>{0}</nobr>" UniqueName="ViewReceiptErrors" |
| HeaderStyle-Width="90px" ItemStyle-Width="90px" SortExpression="ReceiptErrors"> |
| </telerik:GridButtonColumn> |
| <telerik:GridButtonColumn HeaderText="Transaction History" ButtonType="LinkButton" |
| CommandName="ViewTransactionHistory" DataTextFormatString="<nobr>View Transactions</nobr>" |
| UniqueName="ViewTransactionHistory" DataTextField="ManifestID" HeaderStyle-Width="110px" |
| ItemStyle-Width="110px"> |
| </telerik:GridButtonColumn> |
| <telerik:GridButtonColumn HeaderText="Error Description" ButtonType="LinkButton" |
| CommandName="ViewErrorDescription" DataTextField="ReceiptErrors" |
| DataTextFormatString="<nobr>{0}</nobr>" UniqueName="ViewErrorDescription" |
| SortExpression="ReceiptErrors" HeaderStyle-Width="110px" |
| ItemStyle-Width="110px"> |
| </telerik:GridButtonColumn> |
| </Columns> |
| <PagerStyle Mode="Slider" /> |
| </MasterTableView> |
| <ClientSettings AllowColumnHide="true"> |
| <ClientEvents OnCommand="grdManifest_OnCommand" |
| OnRowMouseOver="grdManifest_RowMouseOver" |
| OnRowContextMenu="grdManifest_RowContextMenu"/> |
| <Selecting AllowRowSelect="true" /> |
| <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="330px" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| Private Sub radgrid1_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles radgrid1.DetailTableDataBind |
| If e.DetailTableView.Name = "DetailTable2" Then |
| Dim dropdownColumn As New Telerik.Web.UI.GridDropDownColumn() |
| dropdownColumn.HeaderText = "Test" |
| dropdownColumn.UniqueName = "dropdownColumn" |
| dropdownColumn.DropDownControlType = GridDropDownColumnControlType.DropDownList |
| e.DetailTableView.Columns.Insert(2, dropdownColumn) |
| End If |
| End Sub |
| Private Sub radgrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles radgrid1.ItemCreated |
| If e.Item.OwnerTableView.Name = "DetailTable2" Then |
| If TypeOf e.Item Is GridEditableItem Then |
| Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem) |
| Dim dropdownColumn As GridDropDownColumn = DirectCast(item.OwnerTableView.Columns(2), GridDropDownColumn) |
| Dim data As New Dictionary(Of String, String) |
| data.Add("A", "A") |
| data.Add("B", "B") |
| dropdownColumn.FillValues(data, item) |
| End If |
| End If |
| End Sub |