Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
182 views
Hi All,

I have RadGrid with TemplateColumns, one of the cloumns has a RadComboBox in the edititemtemplate and insertitemtemplate
and in the other i have RadDatePicker in the edititemtemplate and insertitemtemplate also...

in the edit or insert mode and on the selection of the RadComboBox i need to make the other templatecolumn unvisible (the corresponding column header and the RadDatePicker).

i did this using the selectIndexedChanged of the ComboBox and to get this column and set its readonly property to true. and all works fine but i noticed that i need to rebind the Grid so the corresponding column disappear...but this causes that the selection of the Radcombobox to be unselected also since all the grid is rebinded!!!

how can i keep the selection or shall i do it in another way???

attached screen shots of my problem
hope you can help as soon as possible...

Many Thanks
Asa'ad....


Veli
Telerik team
 answered on 23 Aug 2011
1 answer
99 views
I currently have a couple of grids that have some dropdowns as filters.  When I choose a filter where the data is only on page 2 of the grid the grid return 'No Data in Grid' but when I page over to page 2 the data is filtered correctly.  This is happening for both of my grids. 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkQueue.aspx.cs" Inherits="Sterling.SNEF.Tax.Web.WorkQueue" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Work Queue</title>
    <style type="text/css">
        .RadGrid_Web20 .rgCommandRow
        {
            color: #35467C !important;
            height: 24px !important;
        }
    </style>
</head>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
    <script type="text/javascript">      
  
        function pageLoad(sender, eventArgs) {
            if (!eventArgs.get_isPartialLoad()) {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("InitialPageLoad");
            }
        
  
  
        function onRequestStart(sender, args)
        {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >=0)
            {
                args.set_enableAjax(false);
            }
        }
     
    </script>
  
</telerik:RadCodeBlock>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="LoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>                        
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server" HorizontalAlign="Center"
        Width="50px" BorderColor="#99CCFF">
        <asp:Image ID="Image1" runat="server" ImageUrl="Images/loading.gif" ImageAlign="Top">
        </asp:Image>
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Web20">
    </telerik:RadAjaxLoadingPanel>    
    <asp:Panel ID="Panel1" runat="server">
        <asp:Panel ID="Panel2" Visible="false" runat="server">
            <div style="border: thin solid #666666; left: 5px; position: relative; 
                left: 5px; width: 900px; border-collapse: collapse; background-color: #CCCCCC">
                <table>
                    <tr valign="top">
                        <td align="left" style="width: 220px;">
                            <asp:Label ID="lblSearchBy" runat="server" Font-Bold="True" Font-Names="arial,sans-serif"
                                Font-Size="12px">Search by: </asp:Label>
                                </br>                                
                                <asp:DropDownList ID="DropDownList1" runat="server"
                                    Font-Names="Arial" Font-Size="12px">
                                    <asp:ListItem>Select</asp:ListItem>
                                    <asp:ListItem>Hard Stops</asp:ListItem>
                                    <asp:ListItem>HOA</asp:ListItem>
                                    <asp:ListItem>Late Release</asp:ListItem>
                                    <asp:ListItem>Payment Denials</asp:ListItem>
                                    <asp:ListItem>Unworkable</asp:ListItem>
                                    <asp:ListItem>Work Status</asp:ListItem>
                                </asp:DropDownList>
                        </td>
                        <td align="left" style="width: 200px;">
                            <asp:Label ID="Label1" runat="server" Font-Names="arial,sans-serif" Font-Bold="True"
                                Font-Size="12px">Name: </asp:Label>
                                </br>
                                <asp:DropDownList ID="DropDownList2" runat="server"
                                    Font-Names="Arial" Font-Size="12px" Width="100px">
                                    <asp:ListItem>Select   </asp:ListItem>
                                </asp:DropDownList>
                        </td>
                        <td align="left" style="width: 70px;">
                            <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Names="arial,sans-serif"
                                Font-Size="12px">From Date: </asp:Label>
                        </br>
                        <telerik:RadDatePicker ID="dateStart" runat="server" FocusedDate="" Skin="Web20"
                        Width="130px" TabIndex="2">
                        <Calendar ID="Calendar3" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False"
                            ViewSelectorText="x" Skin="Web20" ShowRowHeaders="false">
                        </Calendar>
                        <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                        <DateInput ID="DateInput3" runat="server" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy">                       
                        </DateInput>
                    </telerik:RadDatePicker>                                                                       
                        </td>
                        <td align="left" style="width: 50px;">
                            <asp:Label ID="Label4" runat="server" Font-Bold="True" Font-Names="arial,sans-serif"
                                Font-Size="12px">To Date: </asp:Label>
                         </br>                            
                        <telerik:RadDatePicker ID="RadDatePicker2" runat="server" FocusedDate="" Skin="Web20"
                        Width="130px" TabIndex="2">
                        <Calendar ID="Calendar1" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False"
                            ViewSelectorText="x" Skin="Web20" ShowRowHeaders="false">
                        </Calendar>
                        <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                        <DateInput ID="DateInput1" runat="server" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy">                       
                        </DateInput>
                    </telerik:RadDatePicker>                             
                        </td>
                        <td width="90px" valign="bottom">
                            <asp:Button ID="SearchButton" runat="server" Text="Search" SkinID="Web20"/>
                        </td>
                        <td valign="bottom">
                        <asp:Button ID="DefaultButton" runat="server" Text="Default View" SkinID="Web20"/>
                        </td>
                    </tr>
                </table>
            </div>
            <div style="left: 5px; position: relative; left: 5px;">
                <br />
                <asp:Label ID="lblCurrentandPrior" runat="server" Font-Bold="True" Font-Size="Large"
                    Font-Names="Arial">Open Items Summary</asp:Label>
            </div>
            <div style="border: thin solid #5177B5; left: 5px; position: relative; left: 5px;
                width: 900px;">
                <table border="1" width="800px" style="border-collapse: collapse;">
                    <tr>
                        <td align="center" style="width: 145px; background-color: #7FA5D7;">
                            <asp:Label ID="hdrAssignee" runat="server" Text="Assignees" Font-Bold="True" Font-Names="Arial"
                                Font-Size="12px" ForeColor="White"></asp:Label>
                        </td>
                        <td align="center" style="width: 70px; background-color: #7FA5D7;">
                            <asp:Label ID="Label5" runat="server" Text="States" Font-Bold="True" Font-Names="arial,sans-serif"
                                Font-Size="12px" ForeColor="White"></asp:Label>
                        </td>
                        <td align="center" style="width: 100px; background-color: #7FA5D7;">
                            <asp:Label ID="Label6" runat="server" Text="Jurisdictions" Font-Bold="True" Font-Names="Arial"
                                Font-Size="12px" ForeColor="White"></asp:Label>
                        </td>
                        <td align="center" style="width: 100px; background-color: #7FA5D7;">
                            <asp:Label ID="Label7" runat="server" Text="Total Items" Font-Bold="True" Font-Names="Arial"
                                Font-Size="12px" ForeColor="White"></asp:Label>
                        </td>
                        <td align="center" style="width: 110px; background-color: #7FA5D7;">
                            <asp:Label ID="Label8" runat="server" Text="Still Open" Font-Bold="True" Font-Names="Arial"
                                Font-Size="12px" ForeColor="White"></asp:Label>
                        </td>
                        <td align="center" style="width: 100px; background-color: #7FA5D7;">
                            <asp:Label ID="Label9" runat="server" Text="Unworkable" Font-Bold="True" Font-Names="Arial"
                                Font-Size="12px" ForeColor="White"></asp:Label>
                        </td>
                        <td align="center" style="width: 90px; background-color: #7FA5D7;">
                            <asp:Label ID="Label11" runat="server" Text="Workable" Font-Bold="True" Font-Names="Arial"
                                Font-Size="12px" ForeColor="White"></asp:Label>
                        </td>
                        <td align="center" style="width: 85px; background-color: #7FA5D7;">
                            <asp:Label ID="Label12" runat="server" Text="% Complete" Font-Bold="True" Font-Names="Arial"
                                Font-Size="12px" ForeColor="White"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 145px;">
                            <asp:Label ID="lblhdrAssignees" runat="server" Text=" " Font-Names="Arial" Font-Size="12px"></asp:Label>
                        </td>
                        <td align="right" style="width: 70px;">
                            <asp:Label ID="lblhdrStates" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>
                        </td>
                        <td align="right" style="width: 100px;">
                            <asp:Label ID="lblhdrJurisdictions" runat="server" Font-Names="arial,sans-serif"
                                Font-Size="12px"></asp:Label>
                        </td>
                        <td align="right" style="width: 100px;">
                            <asp:Label ID="lblhdrTotal" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>
                        </td>
                        <td align="right" style="width: 110px;">
                            <asp:Label ID="lblhdrStillOpen" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>
                        </td>
                        <td align="right" style="width: 100px;">
                            <asp:Label ID="lblhdrCannot" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>
                        </td>
                        <td align="right" style="width: 90px;">
                            <asp:Label ID="lblhdrWorkable" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>
                        </td>
                        <td align="right" style="width: 85px;">
                            <asp:Label ID="lblComplete" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>
                        </td>
                    </tr>
                </table>
            </div>
            <br />
            <div style="left: 5px; position: relative; left: 5px;">
                <asp:Label ID="Label10" runat="server" Font-Bold="True" Font-Size="Large" Font-Names="Arial">Open Items by Assignee</asp:Label>
                <telerik:RadGrid ID="grdOpenItemsByAssignee" AllowFilteringByColumn="True" Skin="Web20"
                    AllowSorting="True" AllowPaging="true" PageSize="100" runat="server" AutoGenerateColumns="False"
                    OnNeedDataSource="grdOpenItemsByAssignee_NeedDataSource" ShowStatusBar="true"
                    EnableLinqExpressions="false" Width="900px" Height="255px" OnExcelMLExportRowCreated="grdWorkItemsAssignee_ExcelMLExportRowCreated">
                    <ExportSettings FileName="OpenItemsAssignee" IgnorePaging="True" OpenInNewWindow="True"
                        ExportOnlyData="true" Excel-Format="ExcelML">
                    </ExportSettings>
                    <MasterTableView CommandItemDisplay="Bottom" AllowNaturalSort="false" UseAllDataFields="true"
                        AllowPaging="true">
                        <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                            ShowRefreshButton="false" />
                        <Columns>
                            <telerik:GridBoundColumn DataField="AssigneeName" HeaderText="Assignee" UniqueName="AssigneeName"
                                >
                                <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboBoxTitle" DataTextField="value" DataValueField="value"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("AssigneeName").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="AssigneeIndexChanged" Width="145px"
                                        DataSource="<%# GenerateComboBoxAssigneesJuris() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
  
                                        <script type="text/javascript">
                                    function AssigneeIndexChanged(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("AssigneeName",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>           
                            <telerik:GridBoundColumn DataField="StateName" HeaderText="State" UniqueName="StateName"
                                ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Font-Bold="True" Width="60px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboBoxState" DataTextField="value" DataValueField="value"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("StateName").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="StateIndexChanged1" Width="50px"
                                        DataSource="<%# ComboBoxAssigneeState() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
  
                                        <script type="text/javascript">
                                    function StateIndexChanged1(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("StateName",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn DataField="JurisdictionCount" HeaderText="Jurisdictions"
                                UniqueName="JurisdictionCount" SortExpression="JurisdictionCount" AllowFiltering="false"
                                ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lbJurisdictionAssignee" runat="server" Text='<%# Eval("JurisdictionCount", "{0:N0}")%>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="TotalItems" HeaderText="Total Items" UniqueName="TotalItems"
                                SortExpression="TotalItems" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="75px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblTotalItemsAssignee" runat="server" Text='<%# Eval("TotalItems", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="OpenItemsCount" HeaderText="Still Open" UniqueName="OpenItemsCount"
                                SortExpression="OpenItemsCount" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="75px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lbStillOpenAssignee" runat="server" Text='<%# Eval("OpenItemsCount", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="UnworkableItemsCount" HeaderText="Unworkable"
                                UniqueName="UnworkableItemsCount" SortExpression="UnworkableItemsCount" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="105px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblUnworkableAssignee" runat="server" Text='<%# Eval("UnworkableItemsCount", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="WorkableItemsCount" HeaderText="Workable"
                                UniqueName="WorkableItemsCount" SortExpression="WorkableItemsCount" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="105px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblWorkableAssignee" runat="server" Text='<%# Eval("WorkableItemsCount", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="PercentComplete" HeaderText="% Complete" UniqueName="PercentComplete"
                                SortExpression="PercentComplete" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblPctCompleteAssignee" runat="server" Text='<%# Eval("PercentComplete", "{0:F2}%")%>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <HeaderStyle BorderStyle="Solid" />
                    <ClientSettings>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                </telerik:RadGrid>
            </div>
            <br />
            <div style="left: 5px; position: relative; left: 5px;">
                <asp:Label ID="Label13" runat="server" Font-Bold="True" Font-Size="Large" Font-Names="Arial">Open Items by Jurisdiction</asp:Label>
                <telerik:RadGrid ID="grdOpenItemsByJurisdiction" AllowFilteringByColumn="True" Skin="Web20"
                    AllowSorting="True" AllowPaging="true" PageSize="100" runat="server" AutoGenerateColumns="False"
                    OnNeedDataSource="grdOpenItemsByJurisdiction_NeedDataSource" ShowStatusBar="true" HeaderStyle-Width="900px"
                    EnableLinqExpressions="false" Width="900px" Height="255px" OnExcelMLExportRowCreated="grdWorkItemsJurisdiction_ExcelMLExportRowCreated">
                    <ExportSettings FileName="WorkItemsJurisdiction" IgnorePaging="True" OpenInNewWindow="True"
                        ExportOnlyData="true" Excel-Format="ExcelML">
                    </ExportSettings>
                    <MasterTableView CommandItemDisplay="Bottom" AllowNaturalSort="false" UseAllDataFields="true">
                        <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                            ShowRefreshButton="false" />
                        <Columns>
                          <telerik:GridBoundColumn DataField="Assignee" HeaderText="Assignee" UniqueName="Assignee">
                                <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboBoxTitle" DataTextField="Value" DataValueField="Value"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Assignee").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="TitleIndexChanged1" Width="145px"
                                        DataSource="<%# GenerateComboBoxAssigneesJuris() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
  
                                        <script type="text/javascript">
                                    function TitleIndexChanged1(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("Assignee",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="State" HeaderText="State" UniqueName="State"
                                ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Font-Bold="True" Width="60px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboBoxState" DataTextField="value" DataValueField="value"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("State").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="StateIndexChanged2" Width="50px"
                                        DataSource="<%# ComboBoxAssigneeState() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
  
                                        <script type="text/javascript">
                                    function StateIndexChanged2(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("State",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="WorkStatus" HeaderText="Work Status" UniqueName="WorkStatus"
                                ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboWorkStatus" DataTextField="value" DataValueField="value"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("WorkStatus").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="WorkIndexChanged" Width="150px"
                                        DataSource="<%# ComboBoxWorkStatus() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock4" runat="server">
  
                                        <script type="text/javascript">
                                    function WorkIndexChanged(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("WorkStatus",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <%-- <telerik:GridTemplateColumn DataField="State" HeaderText="State" UniqueName="State"
                                        SortExpression="State" AllowFiltering="false" Visible="true">
                                        <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lbState" runat="server" Text='<%# Eval("State") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>--%>
                            <telerik:GridTemplateColumn DataField="JurisdictionELD" HeaderText="ELD" UniqueName="ELD"
                                SortExpression="JurisdictionELD" AllowFiltering="false" ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Font-Bold="True" Width="60px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lbELD" runat="server" Text='<%# Eval("JurisdictionELD", "{0:M/yy}")%>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="Jurisdiction" HeaderText="Jurisdiction" UniqueName="Jurisdiction"
                                ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboJurisdiction" DataTextField="value" DataValueField="value"
                                        AppendDataBoundItems="true" runat="server" OnClientSelectedIndexChanged="JurisIndexChanged"
                                        Width="150px" DataSource="<%# ComboBoxJurisdictions() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock5" runat="server">
  
                                        <script type="text/javascript">
                                    function JurisIndexChanged(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("Jurisdiction",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ProcurementMethod" HeaderText="Proc Meth" UniqueName="ProcurementMethod"
                                ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboProcMeth" DataTextField="Description" DataValueField="Description"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ProcurementMethod").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="ProcIndexChanged" Width="150px"
                                        DataSource="<%# GenerateProcMeth() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock6" runat="server">
  
                                        <script type="text/javascript">
                                    function ProcIndexChanged(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("ProcurementMethod",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn DataField="PercentComplete" HeaderText="% Complete" UniqueName="clmPctComplete"
                                SortExpression="PercentComplete" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblPctCompleteAssignee" runat="server" Text='<%# Eval("PercentComplete", "{0:F2}%")%>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="TotalItems" HeaderText="Total Items" UniqueName="TotalItems"
                                SortExpression="TotalItems" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblTotalItemsAssignee" runat="server" Text='<%# Eval("TotalItems", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="StillOpenCount" HeaderText="Still Open" UniqueName="StillOpen"
                                SortExpression="StillOpenCount" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lbStillOpenAssignee" runat="server" Text='<%# Eval("StillOpenCount", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="UnworkableItemsCount" HeaderText="Unworkable"
                                UniqueName="Unworkable" SortExpression="UnworkableItemsCount" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="105px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblUnworkableAssignee" runat="server" Text='<%# Eval("UnworkableItemsCount", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="WorkableItemsCount" HeaderText="Workable"
                                UniqueName="WorkableItemsCount" SortExpression="WorkableItemsCount" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="105px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblWorkableAssignee" runat="server" Text='<%# Eval("WorkableItemsCount", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="IsLR" HeaderText="LR" UniqueName="IsLR" 
                                ItemStyle-HorizontalAlign="Center" SortExpression="IsLR">
                                <HeaderStyle Font-Bold="True" Width="60px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboBoxLR" DataTextField="value" DataValueField="value"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("IsLR").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="LRIndexChanged" Width="50px" DataSource="<%# ComboYesNo() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock7" runat="server">
  
                                        <script type="text/javascript">
                                    function LRIndexChanged(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("IsLR",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="IsHOA" HeaderText="HOA" UniqueName="IsHOA"
                                ItemStyle-HorizontalAlign="Center" SortExpression="isHOA">
                                <HeaderStyle Font-Bold="True" Width="60px" HorizontalAlign="Center" Font-Names="Arial" />
                                <FilterTemplate>
                                    <telerik:RadComboBox ID="RadComboBoxHOA" DataTextField="value" DataValueField="value"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("IsHOA").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="HOAIndexChanged" Width="50px" DataSource="<%# ComboYesNo() %>">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="All" />
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock8" runat="server">
  
                                        <script type="text/javascript">
                                    function HOAIndexChanged(sender,args) {
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("IsHOA",args.get_item().get_value(),"EqualTo");
                                          
                                    }
                                        </script>
  
                                    </telerik:RadScriptBlock>
                                </FilterTemplate>
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn DataField="TSPayeeCode" HeaderText="TS Payee" UniqueName="TSPayee"
                                SortExpression="TSPayeeCode" AllowFiltering="false">
                                <HeaderStyle Font-Bold="True" Width="105px" HorizontalAlign="Center" Font-Names="Arial" />
                                <ItemTemplate>
                                    <asp:Label ID="lblTSPayee" runat="server" Text='<%# Eval("TSPayeeCode", "{0:N0}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="AssigneeEmployeeKey" ReadOnly="True" UniqueName="AssigneeEmployeeKey"
                                Visible="False">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <HeaderStyle BorderStyle="Solid" />
                    <ClientSettings>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                </telerik:RadGrid>
            </div>
        </asp:Panel>
    </asp:Panel>
    </form>
</body>
</html>
Any help would be appreciated.
Iana Tsolova
Telerik team
 answered on 23 Aug 2011
3 answers
247 views
My site has a lot of grids for which we do specialized formatting, especially for date/time and currency data. Although it works to use GridTemplateColumns and use Eval statements to do the special formatting, it's becoming increasingly unwieldy to write all those template columns. Therefore, we have created a column class inherited from GridBoundColumn. The primary purpose of this column is to override FormatDataValue with our custom formatting:

protected override string FormatDataValue(object dataValue, GridItem item)
{
    return FormatString(dataValue, DataBinder.GetDataItem(item));
}
 
protected virtual string FormatString(object dataValue, object DataItem)
{
    if (dataValue != null)
    {
        String lc = LanguageCodeField.HasValue()
                            ? DataBinder.Eval(DataItem, LanguageCodeField).ToString()
                            : String.Empty;
        CultureInfo ci = lc.HasValue()
                                 ? new CultureInfo(lc)
                                 : CultureInfo.CurrentCulture;
 
        if(DataFormatString.HasValue())
        {
            return String.Format(ci, DataFormatString, dataValue);
        }
        if (dataValue is DateTime)
        {
            return Dates.GetShortDateTimeString(dataValue as DateTime?);
        }
        if(IsCurrency)
        {
            double dv = Convert.ToDouble(dataValue);
 
            return Cultures.FormatCurrencyValue(lc, dv);
        }
 
        return String.Format(ci, "{0}", dataValue);
       
    }
    return String.Empty;
}
Note: HasValue = !String.IsNullOrEmpty; and Dates.GetShortDateTimeString and Cultures.FormatCurrencyValue are our standard formatting functions for dates and currencies, respectively. LanguageCodeField is a property that we added to our column in order to allow our DataTable to specify different currencies/date formats on a row-by-row basis, and we assume that it will eval to culture strings like "en-US".

Our big problem now is that the Grid Footers aren't applying our formatting. They apparently don't run through FormatDataValue. Here's the code for our column and the GridBoundColumn and I've attached a screen shot that shows the difference when LangaugeCodeField evaluates to "en-GB" even though my computer's culture is the US. (Note: We only enable the footer when LanguageCodeField is the same for all rows -- that's not an issue. If we need to aggregate it, too, we can use "first" with no problem.)
<cc2:MyBoundColumn HeaderText="[Total New]" UniqueName="TOTALEXPENSECALC2" DataField="TOTALEXPENSE" Resizable="false" Reorderable="false"
     LanguageCodeField="LANGUAGECODE" Aggregate="Sum" FooterStyle-CssClass="textbold" FooterText="Page Total " />
<telerik:GridBoundColumn HeaderText="[Total Standard]" UniqueName="TOTALEXPENSECALC3" DataField="TOTALEXPENSE" Resizable="false" Reorderable="false"
      Aggregate="Sum" FooterStyle-CssClass="textbold" FooterText="Page Total " DataFormatString="{0:C}"  />

As you can see in the screen shot, the "Footer Text" property and CssClass are applying properly (Yay!), but we need the Total itself to be formatted in the correct currency. Please help us figure out what to override or what event we have to tie into in order to make custom formatting work for the footer of our inherited column.

--Christina
Radoslav
Telerik team
 answered on 23 Aug 2011
1 answer
100 views
  1. ASP.NET 3.5
  2. OS:  Code runs on Windows Server 2008. IE 8 is on Windows 7 Professional.
  3. Browser:  IE 8
  4. Telerik product version:  RadControls for ASP.NET AJAX Q2 2011.
  5. Preferred programming language:  VB.NET

 
How can I:
1. Add new pagesize values to the RadDataPagerPageSizeField drop-down?
2. Remove, or replace, the hard-coded values?

Pavlina
Telerik team
 answered on 23 Aug 2011
1 answer
171 views

I Have desigend a Master Page whcih holds RADWindowManager and RADWindow control, but when I try tom resize the window it gets resized only Horizontally. Height doesn't get changed need help: Tried both SetSize(0 and SetHeight()

 

function OpenCreateVirtualFarmWindow(button, args) {  

var oManager = GetRadWindowManager();  

var oWnd = oManager.getWindowByName("CaasRADWindow");  

//oWnd.SetSize(400, 400);  

oWnd.SetHeight(1000);

oWnd.SetWidth(400); 

oWnd.SetUrl(

"/CaasCustomerPortal/CreateNewFarm.aspx");  

oWnd.Show(); 

return false

//CreateAndShowModal('/CreateNewFarm.aspx', 'Modal1', 'Default Window at 450 pixels wide', 450);

 

}

Marin Bratanov
Telerik team
 answered on 23 Aug 2011
1 answer
252 views
Hi,

We are using rad input fields throughout our application.  At various times, we disable these fields based on security, etc.  We tried the sample code below in IE and Safari.  The two browsers display differently.  In IE the input values are still readable, however in Safari they are too light.  Is there a way to update the .riDisabled class so the color can be darker?  We need to update this across our application.

Thanks,
Lindsay

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <title>HI MIKE</title>
</head>
<style type="text/css"
HTML BODY .RadInput .riTextBox
{
    border-bottom: 1px solid;
    border-left: 1px solid;
    padding-bottom: 3px;
    padding-left: 1px;
    padding-right: 1px;
    border-top: 1px solid;
    border-right: 1px solid;
    padding-top: 2px;
}
.RadInput_Office2007
{
    font: 12px "segoe ui", arial, sans-serif;
}
HTML BODY .RadInput_Office2007 .riTextBox
{
    border-bottom-color: #abc1de;
    border-top-color: #abc1de;
    font: 12px "segoe ui", arial, sans-serif;
    background: #fff;
    color: #000;
    border-right-color: #abc1de;
    border-left-color: #abc1de;
}
HTML BODY .RadInput_Office2007 .riDisabled
{
    border-bottom-color: #ccdbed;
    border-top-color: #ccdbed;
    color: #8d8d8d;
    border-right-color: #ccdbed;
    border-left-color: #ccdbed;
    cursor: default;
}
</style>
   
<body>
    <input id="Text1" type="text" value ="Disabled" disabled="disabled"  />
    <br />
    <input id="Text2" type="text" value ="Read Only" readonly="readonly" />
    <br />
    <span id="ctl02_ctl01_OBJ_FIRSTNAME_wrapper" class="RadInput RadInput_Office2007" style="white-space:nowrap;">
        <input value="rtyrty" type="text" maxlength="25" size="20" id="ctl02_ctl01_OBJ_FIRSTNAME_text" 
            name="ctl02_ctl01_OBJ_FIRSTNAME_text" class="riTextBox riDisabled" disabled="disabled" style="width:25ex;" />
    </span>        
</body>
</html>
Tsvetina
Telerik team
 answered on 23 Aug 2011
4 answers
127 views
Hi,
I am usiing radgrid in one of my page. In this grid there are 2 columns . One of the column is datetime. I have used GridDateTime column. There are custom filter and custom paging in this page. when I filter some data in datetime column like GeaterThanEqualTo the datasource take correct records from sql query. After binding the grid and setting virtual count the Grid1.Items.Count is showing wrong number of records or Grid1.MasterTableview.items.count also shows incorrect no of records. Paging is showing perfectly. But record displayed is incorrect. Also the datasource shows correct rows. Please provide solution for this as soon as possible.

sandesh
Maria Ilieva
Telerik team
 answered on 23 Aug 2011
6 answers
225 views
I put RadTreeView In RadWindow,  code blow:

RadTreeView:
          <telerik:RadTreeView ID="rtvRules" runat="server"   Height="240px"  Width="250px"  />
RadWindow:
          <telerik:RadWindow ID="rwDetail" runat="server" Behaviors="Close, Pin, Move"  Modal="true" Width="300px"
                    Height="350px"  VisibleStatusbar="False" >

I get data from database and fill this treeview, then  expand nodes .  Now The window show vertical scroll bar.
(btw, I use the window loading a page , the treeview is in the page .)
I put the treeview in div .
<div style="overflow:hidden;width: 260px; height: 250px; />

but The window still show vertical scroll bar.

why? pls help me.
                                                                                                        
Marin Bratanov
Telerik team
 answered on 23 Aug 2011
5 answers
185 views
Hi Telerik,

I am messing around with some proof of concept stuff and I was wondering if it possible to treat a RadWindow as a RadDock such that it is dockable, or store the RadWindow inside of the RadDock in such a way that a Silverlight control would be able to run inside of the RadWindow.

Ideally, the RadWindow would not be visible, only the content inside of it is visible. Really, what I want is a TargetURL for a RadDock.

Is something along these lines possible? I've got the window open with our silverlight running inside of it, but it's not pinned to the dock.

Sean
Marin Bratanov
Telerik team
 answered on 23 Aug 2011
1 answer
124 views
I'm trying to setup paging for RadGrid and it works fine in some scenarios but there are 3 issues with it:

@  Load the page initially, go to the second page, then go back to the first page; the data is not updated so shows the second page data!

@ Load the page initially, change the page size from 10 to 50. expect: the page should immediately be reloaded with the new page size. actual: no change. generally something wrong with the first page!

@ pdf icon disappears when clicking any page number apart from the first. It appears again when the first page number is clicked but the data has the above issue.

Maybe it's not configured properly (it's generated using my RadGridBuilder class). I have set the below properties:

            this.RadGrid.AllowPaging = this.AllowPaging;
            this.RadGrid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;

private void RadGridNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            this.RadGrid.DataSource = this.DataSource;
        }

My Build method is responsible to buld the RadGrid basically:

 public RadGrid Build()
        {
            this.DataSource = GetDataSource();

            SetImmediateProperties();

            SetMasterTableView();

            ConfigureExportSettings();

            this.RadGrid.Rebind();

            return this.RadGrid;
        }

Why do I have the above issues and how to resolve them?

After further investigation, it's clarified that PageIndexChanged event is never raised when the page number 1 is clicked. Not sure why?

Very much appreciated.
Iana Tsolova
Telerik team
 answered on 23 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?