Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
81 views
Can we get the ability to render out a definable empty template if there's no data in the tree?

...or if not doable for Q1 2011, can you just put in the ability for it to render out an Empty Message?

(I know I can do it myself, but I have a bunch of treelists I plan to make so I dont want to have to keep hiding\showing based on dataset results)

Thanks,
Steve
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
 answered on 20 Dec 2010
3 answers
637 views
I have 4 columns in rad grid and i set the 1st, 3rd, 4th column's width to 150 px (<HeaderStyle Width="150px" /> ),  How can i set the 2nd column's  size to auto fill to ocuppy all the empty space in grid?

Regards,
Kenghot.

Ps. I'm using rad asp.net q3 2009
Pavlina
Telerik team
 answered on 20 Dec 2010
1 answer
138 views
I have a .NET asp page that opens a RadWindow. Is there a way to know when the RadWindow is closed by the user? I have a function that I need to execute when the RadWindow is closed. I have tried setting DestroyOnClose to true and calling my function through the OnClientClose event, but setting DestroyOnClose to true causes a popup error on my page. The error says "Exception while executing client event OnClientClose Error:'this._iframe' is null or not an object." I have no idea what is causing that error. Is there a way to detect when the user closes the RadWindow without using DestroyOnClose and OnClientClose? Do you know what is causing my error when I do use those things?

I appreciate any help. Thanks,
Erika
Georgi Tunev
Telerik team
 answered on 20 Dec 2010
2 answers
113 views
Hi,

In this particular page RadAjaxLoadingPanel does not show up. Instead the Grid blinks. I have tried in other pages, it works. What cud be the issue?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Website1.Forecast_Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<head id="Head1" runat="server">
    <title>STATS</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server" />
    <table border="0" cellpadding="2" style="width: 98%">
        <tr>
            <td>
                <asp:Label runat="server" ID="lblMessage" SkinID="infoLabel" />
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <table style="width: 100%">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblNewTitleQueue" runat="server" Text="New Title Queue"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:ImageButton ID="imgNewGridClearFilter" runat="server" ImageUrl="~/App_Themes/STATS/Images/filter_clear.png"
                                                ToolTip="Clear filter" OnClick="imgNewGridClearFilter_OnClick" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <telerik:RadGrid ID="rgNewQueue" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                                    AllowPaging="True" PageSize="5" AllowFilteringByColumn="true" OnSortCommand="rgNewQueue_OnSortCommand"
                                    OnPageIndexChanged="rgNewQueue_OnPageIndexChanged" OnPageSizeChanged="rgNewQueue_OnPageSizeChanged"
                                    OnItemCommand="rgNewQueue_OnItemCommand" Width="925px">
                                    <GroupingSettings CaseSensitive="false" />
                                    <MasterTableView AutoGenerateColumns="false" DataKeyNames="ProductId" GridLines="None"
                                        AllowSorting="true" AllowPaging="true" ShowHeadersWhenNoRecords="true" EnableNoRecordsTemplate="true"
                                        NoMasterRecordsText="No titles found" AllowNaturalSort="false">
                                        <Columns>
                                            <telerik:GridTemplateColumn UniqueName="unqTitle" HeaderText="Title" SortExpression="Title"
                                                AutoPostBackOnFilter="true" AllowFiltering="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="False" FilterControlWidth="150px" DataField="Title">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lnkTitle" CommandName="cmdTitleSelect" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("Title")))%>'></asp:LinkButton>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqStudio" HeaderText="Studio" SortExpression="StudioName"
                                                AutoPostBackOnFilter="true" AllowFiltering="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="False" FilterControlWidth="100px" DataField="StudioName">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblStudio" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("StudioName")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqGenre" HeaderText="Genre" SortExpression="GenreName"
                                                AutoPostBackOnFilter="true" AllowFiltering="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="False" FilterControlWidth="60px" DataField="GenreName">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblGenre" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("GenreName")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqSRP" HeaderText="SRP" SortExpression="SRP"
                                                AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCost" runat="server" Text='<%# DisplayCost(Convert.ToString(Eval("SRP")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqAWP" HeaderText="AWP" SortExpression="AWP"
                                                AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblListPrice" runat="server" Text='<%# DisplayCost(Convert.ToString(Eval("AWP")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqConfig" HeaderText="Config" SortExpression="ConfigCode"
                                                AutoPostBackOnFilter="true" AllowFiltering="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="False" FilterControlWidth="60px" DataField="ConfigCode">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblConfig" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("ConfigCode")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqReleaseDate" HeaderText="Release Date"
                                                SortExpression="ReleaseDate" AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblReleaseDate" runat="server" Text='<%# DisplayDate(Convert.ToString(Eval("ReleaseDate")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqOrderDueDate" HeaderText="Order Due Date"
                                                SortExpression="OrderDueDate" AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblOrderDueDate" runat="server" Text='<%# DisplayDate(Convert.ToString(Eval("OrderDueDate")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqExclusive" HeaderText="Exclusive?" SortExpression="Exclusive"
                                                AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblExclusive" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("Exclusive")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                    </table>
                </telerik:RadAjaxPanel>
            </td>
        </tr>
        <tr>
            <td style="height: 25px">
            </td>
        </tr>
        <tr>
            <td style="height: 2px; background-color: Black">
            </td>
        </tr>
        <tr>
            <td style="height: 25px">
            </td>
        </tr>
        <tr>
            <td>
                <table style="width: 100%">
                    <tr>
                        <td>
                            <asp:Label ID="lblSearchTitle" runat="server" Text="Search for Title"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" colspan="2">
                            <table cellspacing="15px" style="height: 100%">
                                <tr>
                                    <td>
                                        <telerik:RadTextBox ID="rtxtTitle" runat="server" Text="" Width="150px">
                                        </telerik:RadTextBox><br />
                                        <asp:Label ID="lblTitle" runat="server" Text="Title"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadTextBox ID="rtxtStudio" runat="server" Text="" Width="150px">
                                        </telerik:RadTextBox><br />
                                        <asp:Label ID="lblStudio" runat="server" Text="Studio"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadComboBox ID="rcbGenre" runat="server" Width="120px">
                                        </telerik:RadComboBox>
                                        <br />
                                        <asp:Label ID="lblGenre" runat="server" Text="Genre"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadComboBox ID="rcbConfig" runat="server" Width="75px">
                                        </telerik:RadComboBox>
                                        <br />
                                        <asp:Label ID="lblConfig" runat="server" Text="Config"></asp:Label>
                                    </td>
                                    <td valign="top">
                                        <telerik:RadNumericTextBox ID="rtxtSRP" runat="server" Width="80px">
                                        </telerik:RadNumericTextBox><br />
                                        <asp:Label ID="lblSRP" runat="server" Text="SRP"></asp:Label>
                                    </td>
                                    <td valign="top">
                                        <telerik:RadNumericTextBox ID="rtxtAWP" runat="server" Width="80px">
                                        </telerik:RadNumericTextBox><br />
                                        <asp:Label ID="lblAWP" runat="server" Text="AWP"></asp:Label>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <telerik:RadDatePicker ID="rdpRelDate" runat="server" Width="150px">
                                        </telerik:RadDatePicker>
                                        <br />
                                        <asp:Label ID="lblRelDate" runat="server" Text=" Release Date"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="rdpOrderDueDate" runat="server" Width="150px">
                                        </telerik:RadDatePicker>
                                        <br />
                                        <asp:Label ID="lblOrderDueDate" runat="server" Text="Order Due Date"></asp:Label>
                                    </td>
                                    <td colspan="2">
                                        <telerik:RadComboBox ID="rcbStatus" runat="server" Width="150px">
                                        </telerik:RadComboBox>
                                        <br />
                                        <asp:Label ID="lblStatus" runat="server" Text="Status"></asp:Label>
                                    </td>
                                    <td colspan="2">
                                        <asp:CheckBox ID="chkReturnItems" runat="server" Checked="true" Text="Return my items only"
                                            Width="150px" />
                                    </td>
                                    <td valign="top">
                                        <asp:Button ID="btnSearch" runat="server" Text="Search" Width="100px" OnClick="btnSearch_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table style="width: 100%">
                                <tr>
                                    <td>
                                        <asp:Label ID="lblResults" runat="server" Text="Results:"></asp:Label>
                                    </td>
                                    <td align="right">
                                        <asp:ImageButton ID="imgResultsGridClearFilter" runat="server" ImageUrl="~/App_Themes/STATS/Images/filter_clear.png"
                                            ToolTip="Clear filter" OnClick="imgResultsGridClearFilter_OnClick" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <telerik:RadGrid ID="rgSearchTitle" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                                AllowPaging="True" PageSize="5" OnSortCommand="rgSearchTitle_OnSortCommand" OnItemDataBound="rgSearchTitle_ItemDataBound"
                                OnPageIndexChanged="rgSearchTitle_OnPageIndexChanged" OnPageSizeChanged="rgSearchTitle_OnPageSizeChanged"
                                Width="925px">
                                <GroupingSettings CaseSensitive="false" />
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="ProductId" GridLines="None"
                                    AllowSorting="true" AllowPaging="true" ShowHeadersWhenNoRecords="true" EnableNoRecordsTemplate="true"
                                    NoMasterRecordsText="No titles found" AllowNaturalSort="false">
                                    <Columns>
                                        <telerik:GridTemplateColumn UniqueName="unqTitle" HeaderText="Title" SortExpression="Title"
                                            DataField="Title">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:LinkButton ID="lnkTitle" PostBackUrl='<%# "~/Forecasting/TitleForecast.aspx?ProductId=" + Eval("ProductId").ToString()+"&ForecastId="+ Eval("ForecastId").ToString()%>'
                                                    runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("Title")))%>'></asp:LinkButton>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqConfig" HeaderText="Config" SortExpression="ConfigCode"
                                            DataField="Config">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblConfig" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("ConfigCode")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqStudio" HeaderText="Studio" SortExpression="StudioName"
                                            DataField="Studio">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblStudio" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("StudioName")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqGenre" HeaderText="Genre" SortExpression="GenreName"
                                            DataField="Genre">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblGenre" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("GenreName")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqSRP" HeaderText="SRP" SortExpression="SRP"
                                            AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblCost" runat="server" Text='<%# DisplayCost(Convert.ToString(Eval("SRP")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqAWP" HeaderText="AWP" SortExpression="AWP"
                                            AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblListPrice" runat="server" Text='<%# DisplayCost(Convert.ToString(Eval("AWP")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqReleaseDate" HeaderText="Release Date"
                                            SortExpression="ReleaseDate" AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblReleaseDate" runat="server" Text='<%# DisplayDate(Convert.ToString(Eval("ReleaseDate")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqOrderDueDate" HeaderText="Order Due Date"
                                            SortExpression="OrderDueDate" AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblOrderDueDate" runat="server" Text='<%# DisplayDate(Convert.ToString(Eval("OrderDueDate")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqStatus" HeaderText="Status" SortExpression="StatusName"
                                            AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblStatus" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("ForecastStatusName")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqUpdatedBy" HeaderText="Last Updated By"
                                            SortExpression="LastUpdatedName" AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblUpdatedBy" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("LastUpdatedName")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                </table>
                <asp:HiddenField ID="hdnDefSearch" runat="server" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

Rahul
Top achievements
Rank 1
 answered on 20 Dec 2010
4 answers
117 views
Hi,

I am having a problem that I can't figure out.  I am trying to use the RadGrid to manage a list, part of which is a LastUpdated for each item.  It is stored in a database as a DateTime and I am using a LINQ to SQL datasource object.  Everything works great in the grid except the date time picker.  I am using the following code for my Date Time column:

<telerik:GridDateTimeColumn DataField="LastUpdated" HeaderText="LastUpdated"  
                            SortExpression="LastUpdated" UniqueName="LastUpdated"  
                            DataType="System.DateTime" PickerType="DateTimePicker">
</telerik:GridDateTimeColumn> 

The date and time picker icons show up but they are grayed out and I can't do anything with them.  I have searched and searched and no one else seems to have had this problem and I have made sure my code is using the exact same syntax as others who have gotten theirs working.  What am I doing wrong.  Did I forget something important?  I am using the ASPNET AJAX Q2 2008.  Thanks in advance.

Brandon
Kiara
Top achievements
Rank 1
 answered on 20 Dec 2010
1 answer
23 views
Hi,  The issue I'm having is the in IE6, the select drop downs within my page are coming through the tool tip, when the tool tip should be the most foreground item. 

Cheers,

Davoc
Svetlina Anati
Telerik team
 answered on 20 Dec 2010
2 answers
63 views
I am having a problem setting the filter item border. The header and all other item's border is getting set whereas Filter Row items are not.
Can anyone help with this.?
I have attached the screenshot.
I have set the Filter-Item Style under rad grid and MasterTableView Tags. But that doesnt seem to work.
Thanks and Regards,
Niraj Khose
Niraj
Top achievements
Rank 1
 answered on 20 Dec 2010
1 answer
55 views
I want to remove this line below you can see at picture, how I can do it and I want to set this close button hard by with maximize icon
see picture
Georgi Tunev
Telerik team
 answered on 20 Dec 2010
1 answer
80 views
Hi Forum,
Please assist, I am creating the Radgrid programmatically and want to add Radcombox as a filtering item to it. 
 No Clue, and I've tried everything I can find. 
I want the design output like the attached file.

Bali.

 here is sample code i am using.

     rdGrd = new RadGrid();
            rdGrd.AutoGenerateColumns = false;
            rdGrd.AllowPaging = true;           
            rdGrd.AllowSorting = true;
            rdGrd.AllowFilteringByColumn = true;     

            rdGrd.Width = Unit.Pixel(600);
            rdGrd.EnableAJAX = true;
            rdGrd.EnableAJAXLoadingTemplate = true;
            rdGrd.Skin = "None";
                      
            rdGrd.NeedDataSource += new GridNeedDataSourceEventHandler(rdGrd_NeedDataSource);
            rdGrd.ItemDataBound += new GridItemEventHandler(rdGrd_ItemDataBound);
            rdGrd.PageSize = 25;
            rdGrd.ID = "grd";

  GridBoundColumn boundColumn1 = new GridBoundColumn();
                boundColumn1.DataField = "FirmName";
                boundColumn1.UniqueName = "Firm";
                boundColumn1.HeaderText = "Firm";
                boundColumn1.AllowFiltering = true;                
                boundColumn1.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                boundColumn1.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                boundColumn1.ItemStyle.VerticalAlign = VerticalAlign.Top;

  GridTemplateColumn templateColumnRank = new GridTemplateColumn();
                templateColumnRank.AllowFiltering = false;
                templateColumnRank.HeaderTemplate = new NColHeaderTemplate(120, "Rank", "cont3", "2009, 2008", "LeaderRank, LeaderRankM1", "cont4, cont5");
                templateColumnRank.ItemTemplate = new NColItemTemplate(120, "LeaderRank, LeaderRankM1", "cont1, cont2");

  HOW CAN I ADD A RADCOBOBOX HERE AS A FILTERING ITEM

  rdGrd.MasterTableView.Columns.Add(templateColumnRank);
                rdGrd.MasterTableView.Columns.Add(boundColumn1);
  
     this.Controls.Add(rdGrd);

 

public class NColHeaderTemplate : ITemplate
    {
        protected LiteralControl lControl0;
        private int iColumnWidth;
        private int nColHeader;
        private string sTopLevelColumnName;
        private string sTopLevelColumnNameUniqueID;
        private string[] sNBottomColumnName;
        private string[] sNBottomColSortCommandArgument;
        private string[] sNBottomColumnNameUniqueID;
        private string sCellHorizontalAlign;

        public NColHeaderTemplate(int ColumnWidth, string TopLevelColumnName, string TopLevelColumnNameUniqueID, string NBottomColumnName, string NBottomColSortCommandArgument, string NBottomColumnNameUniqueID)
        {
            iColumnWidth = ColumnWidth;
            sTopLevelColumnName = TopLevelColumnName.Trim();
            sTopLevelColumnNameUniqueID = TopLevelColumnNameUniqueID.Trim();
            sNBottomColumnName = NBottomColumnName.Split(Convert.ToChar(","));
            sNBottomColSortCommandArgument = NBottomColSortCommandArgument.Split(Convert.ToChar(","));
            sNBottomColumnNameUniqueID = NBottomColumnNameUniqueID.Split(Convert.ToChar(","));
            //ColHeaderParam = nColHeaderParam.Split(Convert.ToChar(","));
            nColHeader = sNBottomColumnName.Length;
            sCellHorizontalAlign = "Center";
        }

       
        public void InstantiateIn(System.Web.UI.Control container)
        {
            lControl0 = new LiteralControl();
            lControl0.ID = sTopLevelColumnNameUniqueID;
            lControl0.Text = sTopLevelColumnName;

            Table table = new Table();
            table.Width = Unit.Pixel(iColumnWidth);

            TableRow row1 = new TableRow();
            TableRow row2 = new TableRow();

            TableCell cell11 = new TableCell();
           
            cell11.Controls.Add(lControl0);
            cell11.ColumnSpan = nColHeader;

            row1.Cells.Add(cell11);
            table.Rows.Add(row1);

            for (int i = 0; i < nColHeader; i++)
            {

                LinkButton lbControl = new LinkButton();
                lbControl.ID = sNBottomColumnNameUniqueID[i].ToString().Trim();
                lbControl.Text = sNBottomColumnName[i].ToString().Trim();
                lbControl.CommandName = "Sort";
                lbControl.CommandArgument = sNBottomColSortCommandArgument[i].ToString().Trim();

                TableCell cell = new TableCell();
                cell.HorizontalAlign = HorizontalAlign.Center
               
                cell.Controls.Add(lbControl);
                cell.Width = iColumnWidth / nColHeader;
                row2.Cells.Add(cell);

            }

            table.Rows.Add(row2);
            container.Controls.Add(table);
        }
    }

    public class NColItemTemplate : ITemplate
    {

        //protected LiteralControl lControl;
        protected HyperLink lControl;
        private int iColumnWidth;
        private int nColItem;
        private string[] sNBottomDataColumnName;
        private string[] sNBottomDataControlUniqueID;
        private string sBottomDataColumnName;
        private string sCellHorizontalAlign;
       

        public NColItemTemplate(int ColumnWidth, string NBottomDataColumnName, string NBottomDataControlUniqueID)
        {
            sNBottomDataColumnName = NBottomDataColumnName.Split(Convert.ToChar(","));
            sNBottomDataControlUniqueID = NBottomDataControlUniqueID.Split(Convert.ToChar(","));
            nColItem = sNBottomDataColumnName.Length;
            iColumnWidth = ColumnWidth;
            sCellHorizontalAlign = "Center";
        }
       
        public void InstantiateIn(System.Web.UI.Control container)
        {
            Table table = new Table();
            table.Width = Unit.Pixel(iColumnWidth);

            TableRow row1 = new TableRow();
            for (int i = 0; i < nColItem; i++)
            {
                //lControl = new LiteralControl();
                lControl = new HyperLink();
                lControl.ID = sNBottomDataControlUniqueID[i].Trim();
                lControl.Text = sNBottomDataColumnName[i].ToString().Trim();
                lControl.DataBinding += new EventHandler(lControl_DataBinding);

                TableCell cell = new TableCell();
                cell.HorizontalAlign = HorizontalAlign.Center;
                cell.VerticalAlign = VerticalAlign.Top;
               

                cell.Width = iColumnWidth / nColItem;
                cell.Controls.Add(lControl);
                row1.Cells.Add(cell);
            }
            table.Rows.Add(row1);
            container.Controls.Add(table);
            container.Controls.Add(new LiteralControl("<br />"));
        }
        public void lControl_DataBinding(object sender, EventArgs e)
        {
           // LiteralControl l = (LiteralControl)sender;
            HyperLink l = (HyperLink)sender;
            GridDataItem container = (GridDataItem)l.NamingContainer;
            sBottomDataColumnName = l.Text.Trim();
            l.Text = ((DataRowView)container.DataItem)[sBottomDataColumnName].ToString();
            l.Target = "_blank";
            l.NavigateUrl = "http://www.google.com/search?hl=en&q=" + ((DataRowView)container.DataItem)[sBottomDataColumnName].ToString() + "&btnG=Google+Search";

        }

 

    }

Maria Ilieva
Telerik team
 answered on 20 Dec 2010
1 answer
72 views
Hey, i am using Rad Grid containing a column of type string having its AllowFilter="true".
I am facing a weird situation, when i try to write in the filter a specific value (it is the first value for that column in the grid), copy and pasted from grid values on that column and click contains.
The filter returns "no records to be displayed".
Although, if i tried it with any other value also contained in the grid it works fine.
i don't know why this is happening? 
Pavlina
Telerik team
 answered on 20 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?