Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
151 views
As I can catch the event to filter a column of the grid?
Carlos Rodriguez
Top achievements
Rank 1
 answered on 31 May 2011
2 answers
99 views
Project background:
C# ASP.NET project using a custom class to completely define the RadGrid definition. I am using advanced databinding and ajax.

So far everything I have implemented is working fine. One of the requirements I have is that the user upon entry to the form will select an item from dropdownlist control and then click a button to fetch the datasource based on their selection. This is done because the available selections do not return the same data elements. After the retrieval of the data I am not able to get the grid to display the data. I have  added to following to the onClick event of the button. I am using mock data at this time so __getData = true; signifies I want to return data rather than an empty grid. The .Rebind Method is executing NeedDataSource and the DataTable returned from PolicyAPI.GetPolicyData(__getData) has data but the grid does not seem to reload. I have checked all of the samples but have not found any direction. I appreciate any assistance.

protected void Page_Init(object source, EventArgs e)
{
    this.__policyRadGrid = PolicyRadGrid.GridDefinition();
    this.PlaceHolder1.Controls.Add(this.__policyRadGrid);
}

protected void Page_Load(object sender, EventArgs e)
{
    this.__policyRadGrid.NeedDataSource += new GridNeedDataSourceEventHandler(PolicyRadGrid_NeedDataSource);
}

protected void btnRetrieveData_OnClick(object sender, EventArgs e)
{
    __getData = true;
  this.__policyRadGrid.Rebind();
}
  
protected void PolicyRadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
  this.__policyRadGrid.DataSource = PolicyAPI.GetPolicyData(__getData);
}
Tim
Top achievements
Rank 2
 answered on 31 May 2011
5 answers
209 views
Hi,

I have a Telerik RadGrid and when I change page size from 10 to 20 next 10 rows are not formated (see attachment - grid-result-page.jpg, grid-page.jpg). I use client-side databinding. Where I do mistake?
Thanks for answer.

My grid code
<telerik:RadGrid ID="grdResult" runat="server" AllowPaging="True"
            AllowSorting="True" AutoGenerateColumns="False" GridLines="None"
            PageSize="20" Width="100%" BorderStyle="None" EnableEmbeddedSkins="False"
            EnableViewState="true" Culture="de-DE" ShowFooter="True" ShowGroupPanel="True">
            <ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="true" DataBinding-CountPropertyName="CountProduct" DataBinding-DataPropertyName="DataProduct">
                <Selecting AllowRowSelect="true" />
                <DataBinding Location="WebServiceProduct.asmx" SelectMethod="GetDataAndCount" EnableCaching="false"/>
                <ClientEvents OnDataBinding="grdResult_DataBinding" OnDataBound="grdResult_DataBound"/>
            </ClientSettings>
            <HeaderStyle Wrap="False" />
            <MasterTableView GroupLoadMode="Client">
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="USER_Profile" FieldName="USER_Profile"></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="USER_Profile"></telerik:GridGroupByField>
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                <Columns>
                    <telerik:GridBoundColumn DataField="GroupIcon" HeaderText="Group" UniqueName="colResultGroup" ItemStyle-CssClass="grid_td_line"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Text1" HeaderText="Typ Caption" UniqueName="colResultText1" ItemStyle-CssClass="grid_td_line"></telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="USER_Profile" HeaderText="USER_Profile" UniqueName="USER_Profile" ItemStyle-CssClass="grid_td_line"></telerik:GridBoundColumn>
                    ...
                </Columns>
          </MasterTableView>
          <PagerStyle Mode="NextPrevAndNumeric" PageButtonCount="10" />
          <GroupingSettings ShowUnGroupButton="true" />
</telerik:RadGrid>



Best regards
Roman
Roman Krsko
Top achievements
Rank 1
 answered on 31 May 2011
3 answers
84 views
I am trying to generate Excel ML Export file but no cell is getting created. It is generating file with empty rows. Any ideas ?
Daniel
Telerik team
 answered on 31 May 2011
1 answer
208 views
Hi guys, hope you can help me with this, I have a radcombobox wich i want to fill with data using linq to entities, I 've been trying with this code in the method I use to fill the combo box and set a breakpoint in that, when I run my program the results in the breakpoint appears correctly but when my combo box never gets filled.
Here's the query I implement to fill the combobox
 
private void llenacomboedificio()
       {
           var bdinstedificio = new BD_INSTEntities();
           var query = from edi in bdinstedificio.Inmuebles
                       select edi.nom_inm;
           rdCmbEdificio.DataSource = query.ToList();
       }

Hope your help.
Cristian
Top achievements
Rank 1
 answered on 31 May 2011
1 answer
272 views
I set up the AJAX RAD Grid with the black theme, but when I did the demo for management, there was a complaint that there was not enough color separation between the rows. I can change the value for either one in the grid properties, but I have a table nested within a Template Column. The <td> receives the colors from the CSS (.RadGrid_Black .rgAltRow td) so the borders of the table don't match the new property settings of the grid. If I edit the <td> inside the Template Column, it doesn't take into account the Alternate rows and sets the colors across all rows.

What is the best/preferred way for me to match these colors? Edit the CSS? (How does that get into my project?) Create my own CSS? (Do I need a separate class for the .rgAltRow?)

Gimmik
Top achievements
Rank 1
 answered on 31 May 2011
3 answers
41 views
On masked textboxes in IE7 when the user enters the control and enters the first charachter the control jumps the cursor to the end of the control and the value cannot be entered. I don't want to have to ask all of our users to upgrade their browser just because of a change in your control collection. This only started happening after the most recent update. Any suggestions?

Thanks!
jfkrueger
Top achievements
Rank 1
 answered on 31 May 2011
1 answer
151 views
how I can get the number of items in a RadTreeList from the client side. On the server side is done as follows:

RadTreeList1.Items.Count
Ronald
Top achievements
Rank 1
 answered on 31 May 2011
2 answers
96 views
I have been trying everthing to get this to work! However, the btnBibleBook button is not being exclued from the Ajax container. Therefor the routine I have attached to the button is not functioning properly. I have created a function, "conditionalPostback" that should be excluding the btnBibleBook button from the Ajax framework. It does not appear to be triggering properly. There is quite a bit of code here, but I didn't want to leave anything out. I did not include the Codebehind, but if anyone thinks it is necessary I will include it. Here is the Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Copy of TheBible.aspx.vb" Inherits="BibleResources_TheBible" %>
  
<%@ Register Src="~/Gadgets/Header.ascx" TagName="Header" TagPrefix="wisc" %>
<%@ Register Src="~/Gadgets/Footer.ascx" TagName="Footer" TagPrefix="wisc" %>
<%@ Register Src="~/Gadgets/SocialNetworks.ascx" TagName="SocialNetworks" TagPrefix="wisc" %>
<%@ Register Src="~/Gadgets/QuestionsGadget.ascx" TagName="QuestionsGadget" TagPrefix="wisc" %>
<%@ Register Src="~/Gadgets/ContentVoterGadget.ascx" TagName="ContentVoterGadget"
    TagPrefix="wisc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Scripture Seeds - The Holy Bible</title>
    <meta content="Scripture Seeds Foundation" name="Tybee_Island" />
    <meta content="The Scripture Seeds Foundation is a bible-based, Christian outreach and evangelistic foundation dedicated to spreading the truth of God's Word."
        name="description" />
    <meta content="The Scripture Seeds Foundation believes that faith comes by hearing the Word of God."
        name="abstract" />
    <meta content="christian, bible, word, Gods Word, authority, creed, doctrine, guide, guidebook, handbook, manual, sacred writ, sacred writings, scripture, old testament, new testament, good news"
        name="keywords" />
    <meta content="Wireless Information Systems Corp., www.wirelessinfosys.com" name="author" />
    <meta content="Copyright © 2011 Scripture Seeds Foundation, All Rights Reserved"
        name="copyright" />
    <meta content="index,follow" name="robots" />
    <link rel="shortcut icon" href="~/images/papyrus.ico" type="image/x-icon" />
    <link rel="icon" href="~/images/papyrus.ico" type="image/x-icon" />
    <link href="~/App_Themes/Seeds/Scripture.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="frmBibleBooks" runat="server" style="text-align: center">
    <table id="tblBorder" align="center" cellpadding="0" cellspacing="0" border="0" width="975px">
        <tr>
            <td>
                <div class="page">
                    <wisc:Header ID="ctlHeader" runat="server" />
                    <table id="tblFrame" align="center" cellpadding="2" cellspacing="0" border="1" width="100%">
                        <tr>
                            <td>
                                <div id="PageContent" align="center">
                                    <table id="tblMain" runat="server" cellpadding="4" width="100%" align="center" border="0">
                                        <tr>
                                            <td id="LeftCol">
                                                <wisc:ContentVoterGadget ID="ctlContentVoterGadget" runat="server" />
                                            </td>
                                            <td id="MainCol">
                                                <table id="tblCenterCol" runat="server" cellpadding="6" width="100%" align="center"
                                                    border="1">
                                                    <tr>
                                                        <td id="colContent">
                                                            <h1>
                                                                The Holy Bible</h1>
                                                            <div style="margin-left: 75px; margin-right: 20px;">
                                                                <b style="color: #95c9f3;">THE OLD TESTAMENT<br />
                                                                </b>There are 39 books in the Old Testament, generally separated into 4 divisions:
                                                                <ol>
                                                                    <li>The Pentateuch (5 Books), traditionally designated as the 5 books of Moses.
                                                                    </li>
                                                                    <li>Historical Books (12 Books), from Joshua to Esther. </li>
                                                                    <li>Poetical Books (5 Books), from Job to Song of Solomon. </li>
                                                                    <li>Prophetical Books (17 Books), including the writings of the 5 Major Prophets, from
                                                                        Isaiah to Daniel, and the 12 Minor Prophets from Hosea to Malachi. </li>
                                                                </ol>
                                                                <br />
                                                                <b style="color: #95c9f3;">THE NEW TESTAMENT<br />
                                                                </b>There are 27 books in the New Testament, generally separated into 4 divisions:
                                                                <ol>
                                                                    <li>The Gospels (4 Books), from Matthew to John.</li>
                                                                    <li>Historical Books (1 Book), Acts.</li>
                                                                    <li>Doctrinal Books (21 Books), from Romans to Jude. </li>
                                                                    <li>Prophetical Book (1 Book), Revelation.</li>
                                                                </ol>
                                                            </div>
                                                            <p>
                                                                 </p>
                                                            <div>
                                                                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="conditionalPostback">
                                                                    <AjaxSettings>
                                                                        <telerik:AjaxSetting AjaxControlID="lvBibles">
                                                                            <UpdatedControls>
                                                                                <telerik:AjaxUpdatedControl ControlID="lvBibles" LoadingPanelID="panReLoadBooks" />
                                                                            </UpdatedControls>
                                                                        </telerik:AjaxSetting>
                                                                    </AjaxSettings>
                                                                </telerik:RadAjaxManager>
                                                                <script type="text/javascript">
                                                                    function conditionalPostback(sender, args) {
                                                                        var theRegexp = new RegExp("\.btnBibleBook$", "ig");
                                                                        if (args.get_eventTarget().match(theRegexp)) {
                                                                            args.set_enableAjax(false);
                                                                        }
                                                                    }
                                                                </script>
                                                                <telerik:RadAjaxLoadingPanel ID="panReLoadBooks" runat="server" Transparency="30"
                                                                    EnableSkinTransparency="false" BackColor="#E0E0E0">
                                                                    <asp:Image ID="imgLoading" runat="server" ImageUrl="~/Images/sm_loading.gif" Width="60px"
                                                                        Style="border: 0px;" AlternateText="Loading..." ToolTip="Loading..." />
                                                                </telerik:RadAjaxLoadingPanel>
                                                                <div>
                                                                    <asp:Panel ID="panBooks" runat="server">
                                                                        <asp:Label ID="lblDataSource" runat="server" Visible="false"></asp:Label>
                                                                        <div align="center">
                                                                            <span style="vertical-align: middle; font-weight: bold; padding-left: 5px;">Bible Listing:</span>
                                                                            <asp:DropDownList ID="ddlBibleList" runat="server" AutoPostBack="True" ToolTip="Listing of Bible Books and Categories."
                                                                                SelectedIndexChanged="ddlBibleList_SelectedIndexChanged">
                                                                            </asp:DropDownList>
                                                                        </div>
                                                                        <div align="center">
                                                                            <asp:RadioButtonList ID="optSortField" runat="server" RepeatDirection="Horizontal"
                                                                                AutoPostBack="true">
                                                                                <asp:ListItem Text="Name" Value="Book_Name" />
                                                                                <asp:ListItem Text="Category" Value="Book_Category" />
                                                                                <asp:ListItem Text="Testament" Value="Book_Testament" />
                                                                                <asp:ListItem Selected="True" Value="Bible_ID">Bible Order</asp:ListItem>
                                                                            </asp:RadioButtonList>
                                                                            <div style="padding-left: 3px">
                                                                                <p>
                                                                                </p>
                                                                                <span style="color: black;">Sort expression: </span>
                                                                                <asp:Label ID="lblExpression" runat="server" Text=" " />
                                                                            </div>
                                                                        </div>
                                                                        <div align="center">
                                                                            <asp:Button ID="btnASC" runat="server" Width="122px" Text="Ascending" OnClick="btnASC_Click" />
                                                                            <asp:Button ID="btnDSC" runat="server" Width="122px" Text="Descending" OnClick="btnASC_Click" />
                                                                            <asp:Button ID="btnNone" runat="server" Width="122px" Text="None" OnClick="btnASC_Click" />
                                                                        </div>
                                                                        <telerik:RadListView ID="lvBibles" runat="server" ItemPlaceholderID="BookContainer"
                                                                            AllowPaging="True" PageSize="12" DataKeyNames="Book_ID" Font-Names="Calibri,Helvetica,Verdana,Arial,Serif"
                                                                            Font-Size="12px" OnItemEditing="DownLoadPDF">
                                                                            <LayoutTemplate>
                                                                                <fieldset id="RadListView" style="float: left; width: 97%;">
                                                                                    <legend>Bible Books</legend>
                                                                                    <asp:PlaceHolder ID="BookContainer" runat="server" />
                                                                                    <div style="clear: both" />
                                                                                    <div style="padding: 5px;">
                                                                                        <div style="float: left; margin-left: 30%;">
                                                                                            <asp:Button runat="server" ID="btnFirst" CommandName="Page" CommandArgument="First"
                                                                                                Text="First" Enabled="<%#Container.CurrentPageIndex > 0 %>" />
                                                                                            <asp:Button runat="server" ID="btnPrev" CommandName="Page" CommandArgument="Prev"
                                                                                                Text="Prev" Enabled="<%#Container.CurrentPageIndex > 0 %>" />
                                                                                            <span style="vertical-align: middle;">  Page <strong>
                                                                                                <%#Container.CurrentPageIndex + 1%></strong> of <strong>
                                                                                                    <%#Container.PageCount%>  </strong></span>
                                                                                            <asp:Button runat="server" ID="btnNext" CommandName="Page" CommandArgument="Next"
                                                                                                Text="Next" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" />
                                                                                            <asp:Button runat="server" ID="btnLast" CommandName="Page" CommandArgument="Last"
                                                                                                Text="Last" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" />
                                                                                        </div>
                                                                                        <div>
                                                                                            <span style="vertical-align: middle; font-weight: bold; padding-left: 5px;">Page Size:</span>
                                                                                            <telerik:RadComboBox runat="server" ID="cmbPageSize" OnSelectedIndexChanged="cmbPageSize_SelectedIndexChanged"
                                                                                                AutoPostBack="true" Width="40px" SelectedValue="<%#lvBibles.PageSize %>" Skin="Black">
                                                                                                <Items>
                                                                                                    <telerik:RadComboBoxItem Text="2" Value="2" />
                                                                                                    <telerik:RadComboBoxItem Text="4" Value="4" />
                                                                                                    <telerik:RadComboBoxItem Text="6" Value="6" />
                                                                                                    <telerik:RadComboBoxItem Text="8" Value="8" />
                                                                                                    <telerik:RadComboBoxItem Text="10" Value="10" />
                                                                                                    <telerik:RadComboBoxItem Text="12" Value="12" />
                                                                                                    <telerik:RadComboBoxItem Text="14" Value="14" />
                                                                                                </Items>
                                                                                            </telerik:RadComboBox>
                                                                                        </div>
                                                                                    </div>
                                                                                </fieldset>
                                                                            </LayoutTemplate>
                                                                            <ItemTemplate>
                                                                                <fieldset style="float: left; width: 97%; height: 300px; background-color: Gray;">
                                                                                    <legend><b>Title</b>: <span style="color: #000000; font-weight: bold;">
                                                                                        <%#Eval("Book_Name")%></span> </legend>
                                                                                    <div class="details">
                                                                                        <div class="photo-container">
                                                                                            <telerik:RadBinaryImage runat="server" ID="bBinSermon" DataValue='<%#Eval("Book_Image") %>'
                                                                                                AutoAdjustImageControlSize="false" Height="65px" ToolTip='<%#Eval("Book_Name", "Book of {0}") %>'
                                                                                                AlternateText='<%#Eval("Book_Name", "Book of {0}") %>' BorderColor="White" BorderStyle="Solid"
                                                                                                BorderWidth="3px" />
                                                                                        </div>
                                                                                        <div class="data-container">
                                                                                            <ul>
                                                                                                <li>
                                                                                                    <label>
                                                                                                        <b style="color: Gray;">Testament:</b> <span style="color: #95c9f3;"><%#GetTestament(Eval("Book_Testament"))%></span></label></li>
                                                                                                <li>
                                                                                                    <label>
                                                                                                        <b style="color: Gray;">Book:</b> <span style="color: #daa838;"><%#Eval("Book_Name")%></span></label></li>
                                                                                                <asp:TextBox ID="txtName" runat="server" Visible="false" Text='<%#Eval("Book_Name")%>'></asp:TextBox>
                                                                                                <asp:TextBox ID="txtID" runat="server" Visible="false" Text='<%#Eval("Book_ID")%>'></asp:TextBox>
                                                                                                <li>
                                                                                                    <label>
                                                                                                        <b style="color: Gray;">Category:</b> <%#Eval("Book_Category")%></label><br />
                                                                                                    <br />
                                                                                                    <br />
                                                                                                    <br />
                                                                                                </li>
                                                                                                <li>
                                                                                                    <label>
                                                                                                        <b style="color: Gray;">Summary: </b>
                                                                                                    </label>
                                                                                                    <label>
                                                                                                        <span style="font-weight: normal; text-align: justify; font-size: 12px; font-family: Calibri, Helvetica, Verdana, Arial, Serif;">
                                                                                                            <%#TrimSummary(Eval("Book_Description"))%></span>
                                                                                                    </label>
                                                                                                </li>
                                                                                            </ul>
                                                                                            <br />
                                                                                            <br />
                                                                                            <div align="center">
                                                                                                <asp:Button ID='btnBibleBook' runat="server" Text='<%#GetPDF(Eval("Book_Name"), Eval("Book_ID"))%>'
                                                                                                    CommandName="Edit" CausesValidation="false" />
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </fieldset>
                                                                            </ItemTemplate>
                                                                        </telerik:RadListView>
                                                                    </asp:Panel>
                                                                </div>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td id="RightCol" valign="top">
                                                <wisc:SocialNetworks ID="ctlSocialNetworks" runat="server" />
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:Label ID="lblError" runat="server" CssClass="ErrorMessageDB"></asp:Label>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <wisc:Footer ID="ctlFooter" runat="server" />
                </div>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

I would sure appreciate anyones help on this. In the codebehind routine "DownLoadPDF" fires and calls the external routine which forces a PDF to be downloaded, but because of the AJax the external routine errors out and the file is not downloaded.
If I remove All the Ajax, the application functions properly.
Art Handy
Top achievements
Rank 2
 answered on 31 May 2011
2 answers
88 views
Hello,

I want to show 10 records out of 100,000 records from database using telerik grid.

So, i am plannint to use telerik grid's inbuild paging.
Now, the issue is if i need to use telerik paging, i must have 100,000 records with me. So, my sql query will take too much time as i will get 100,000 records for paging.

Can i pass argument to fetch 10 records and it takes only 10 records from database and manage paging too in telerik-grid??

Note: i will also use telerik grid's filtering and sorting too. So, the solution should support paging as well as filtering and sorting.

Please suggest.

Thanks.
Minesh Doshi
Top achievements
Rank 1
 answered on 31 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?