Thanks in advance to anybody who may be able to help me.
I am having two problems with an implementation of RadGrid. The first is how to define a custom filter method for percentage values. I have a grid with some columns as integers and others as percentages (double). I would like for the user to be able to filter these values based on their percentage value (0-100) and not their rate value (0-1). For example, filter by 1.79 as opposed to 0.0179. I realize the easiest way to do this is to cast the user input as a double and divide by 100 to obtain the corresponding rate, however I am not sure how to do this.
The second problem I am having is scrolling with frozen columns and headers. It seems that when I declare frozen columns, the grid does not scroll to the right entirely and truncates the right-most columns from view. The more frozen columns I have, the more columns get truncated from the right. Below are screenshots to illustrate the problem:
Without frozen columns (Link Outage is right-most column): http://216.196.244.34/scroll.jpg
With 2 frozen columns (Link Outage is no longer viewable): http://216.196.244.34/freezescrollbroken.jpg
NOTE: The RadGrid I have declared in code has the static columns as well as a dozen or so dynamic columns, generated at run-time.
| RadGrid1.ClientSettings.Scrolling.AllowScroll = true; |
| RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2; |
| RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = true; |
| <telerik:RadGrid Width="800px" OnItemCommand="radGridItemCommand" Skin="Hay" ID="RadGrid1" runat="server" AllowPaging="True" AllowFilteringByColumn="True" AllowSorting="True" GridLines="None" AutoGenerateColumns="False" OnItemDataBound="radGridItemDataBound" OnNeedDataSource="radGridNeedDataSource" > |
| <MasterTableView Height="100%" PageSize="24" RetrieveAllDataFields="false" AllowSorting="true"> |
| <Columns> |
| <telerik:GridBoundColumn FilterImageUrl="img/arrow-icon.png" FilterControlWidth="50" DataField="Data_Date" SortExpression="Data_Date" HeaderText="Date" DataFormatString="{0:MM/dd/yy}"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn Visible="false" FilterControlWidth="15" DataField="Data_Hour" SortExpression="Data_Hour" HeaderText="Hour2"></telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn FilterImageUrl="img/arrow-icon.png" FilterControlWidth="15" HeaderText="Hour" SortExpression="Data_Hour"> |
| <ItemTemplate> |
| <asp:LinkButton ID="hourLinkButton" runat="server" CommandName="Click" CausesValidation="false" CommandArgument='<% # Eval("Data_Date").ToString() + "|" + Eval("Data_Hour").ToString() %>' Text='<% #Eval("Data_Hour") %>' OnClick="AntennaLevel"/> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn Visible="false" FilterControlWidth="15" DataField="Week" SortExpression="Week" HeaderText="Week"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn Visible="false" FilterControlWidth="15" DataField="Month" SortExpression="Month" HeaderText="Month"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn FilterControlWidth="15" Visible="False" DataField="MarketNum" SortExpression="MarketNum" HeaderText="MarketNum"></telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <AlternatingItemStyle BackColor="#c9fca3"/> |
| </telerik:RadGrid> |
Thanks again for any assistance you can provide,
Kyle