Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
131 views
Hi 

 We are evaluating Telerik RadImageEditor for use in my development.We would like to know if the Image editor supports the following needs

1)Server fonts support

2)Ability to add,visualize Bleed,safety Line .Change Bleed ,safety Line 

3)Output formats of Image Editor

4)Color support

5)Support for Baseline grid alignment

6)Support for Paragraph and Character styles

Thanks in advance!

Regards,
Dhivya
Slav
Telerik team
 answered on 24 Jun 2014
3 answers
541 views
  Hello
 I want to generate Radgrid templates column Dynamically on button click event.
as shown in images attached below  Edit ,Delete and ProductNames columns are Fixed
I just want to add Country Column dynamically on AddCountry Button click
Using the following code the new column gets added but the previous column gets deleted , I want to maintain the previous column and the values in it
as shown it attached images

Please check if I am missing any thing in the code below
thanks
waiting for reply
Kishor




Dim
objProductDataTable As New tblProductDataTable
 Dim objProductTableAdapter As New tblProductTableAdapter
 
   Private Class MyTemplate
       Implements ITemplate
       Protected textBox As TextBox
       Private colname As String
 
       Public Sub New(ByVal cName As String)
           MyBase.New()
           colname = cName
       End Sub
 
       Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
           textBox = New TextBox
           textBox.ID = "abc"
           container.Controls.Add(textBox)
       End Sub
   End Class
 
 
   Protected Sub btnAddCountry_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddCountry.Click
 
 
       objProductDataTable = objProductTableAdapter.GetProducts()
 
       RadGrid1.DataSource = objProductDataTable
       Dim templateColumnName As String = "Col1"
       Dim templateColumn As New GridTemplateColumn()
       templateColumn.ItemTemplate = New MyTemplate(templateColumnName)
       templateColumn.HeaderText = txtCountry.Text
       templateColumn.ItemStyle.Font.Bold = True
       templateColumn.HeaderStyle.Font.Bold = True
 
       RadGrid1.MasterTableView.Columns.Add(templateColumn)
       RadGrid1.DataBind()
 
 
       For i = 0 To objProductDataTable.Rows.Count - 1
           Dim lbl As Label = DirectCast(RadGrid1.Items(i).FindControl("lblproduct"), Label)
           lbl .Text = objProductDataTable.Rows(i).Item("ProductName")
       Next
 
 
   End Sub
Konstantin Dikov
Telerik team
 answered on 24 Jun 2014
4 answers
178 views
Hi, i want to change the ContentUrl of a RadPane by using a RadButton of type LinkType. I'm using 2012.3.1308.40 and 2014.2.618.40.

I think i'm missing something because there were a simple and neat mode to achieve this without using an iframe inside the RadPanel or additional javascript.

01.<!DOCTYPE html>
03.<head runat="server">
04.    <title></title>
05.    <style type="text/css">
06.        html, body, form {
07.            width: 100%;
08.            height: 100%;
09.            padding: 0;
10.            margin: 0;
11.            border-collapse: collapse;
12.        }
13.    </style>
14.</head>
15.<body>
16.    <form id="form1" runat="server">
17.        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
18.        <telerik:RadSplitter Height="100%" ID="RadSplitter1" Orientation="Horizontal" runat="server" Width="100%">
19.            <telerik:RadPane Height="36px" ID="headerPane" runat="server" Width="100%">
20.                <telerik:RadButton ButtonType="LinkButton" ID="test" NavigateUrl="http://www.telerik.com" runat="server" Target="contentPane" Text="TEST" />
21.            </telerik:RadPane>
22.            <telerik:RadPane ContentUrl="about:blank" Height="500px" ID="contentPane" runat="server">
23.            </telerik:RadPane>
24.        </telerik:RadSplitter>
25.    </form>
26.</body>
27.</html>
Gullo
Top achievements
Rank 1
 answered on 24 Jun 2014
2 answers
77 views
Hı , 

We Devoloped a RadPage  With a  RadGrid  ,
Seems No Problem When We Test This Page In Our Local Server . 
But After Publishıng Project  Our All Grıd Actıons Are  Not Working. Fired Postback But Not Open Any Nested Items , Not Paging , Not Filtering Grid 

(Our Project We Use Too Many Grids But Only 3 Page  We Have Problem Like This  )

Our Source Code Of Client Side  : 


001.<%@ Page Title="" Language="C#" MasterPageFile="~/TYS_T.Master" AutoEventWireup="true"
002.    CodeBehind="Talep_Takibi.aspx.cs" Inherits="TYS20.Talep_Takibi" %>
003. 
004.<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
005.    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
006.        <script type="text/javascript">
007. 
008.            function onClientClearButtonClicked(sender, args) {
009.                disableConversationWindow();
010.                isEnabled = false;
011.            }
012. 
013.        </script>
014.    </telerik:RadCodeBlock>
015. 
016. 
017.    <div id="content" class="content maxContentHeigth">
018.        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
019.            ConnectionString="<%$ ConnectionStrings:TYS20DEVConnectionString %>"
020.            SelectCommand="(select c.DEGER as 'ACILIYETDERECESI' , p.ID from PARAMETRE p inner join CEVIRI c on  (p.ID=c.PARAMETREID) where  USTPARAMETREID='352EA330-9E16-4014-86D3-08372E4A3881' and c.DILID= @SAYFA)">
021.            <SelectParameters>
022.                <asp:SessionParameter DefaultValue="tr-TR" Name="SAYFA" SessionField="userLang"
023.                    Type="String" />
024.            </SelectParameters>
025.        </asp:SqlDataSource>
026.        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
027.            ConnectionString="<%$ ConnectionStrings:TYS20DEVConnectionString %>"
028.            SelectCommand="(select c.DEGER as 'ISLEMDURUMU' , p.ID from PARAMETRE p inner join CEVIRI c on  (p.ID=c.PARAMETREID) where  USTPARAMETREID='AC2788D4-BEB7-4E6F-8BF0-AF7D2AE1A84D' and c.DILID= @SAYFA)">
029.            <SelectParameters>
030.                <asp:SessionParameter DefaultValue="tr-TR" Name="SAYFA" SessionField="userLang"
031.                    Type="String" />
032.            </SelectParameters>
033.        </asp:SqlDataSource>
034. 
035.        <asp:SqlDataSource ID="SqlDataSource3" runat="server"
036.            ConnectionString="<%$ ConnectionStrings:TYS20DEVConnectionString %>"
037.            SelectCommand="(select distinct c.DEGER,k.ID,k.USTKATEGORIID from  KATEGORI k inner join CEVIRI c  on (c.PARAMETREID=k.ID) where c.DILID= @SAYFA)">
038.            <SelectParameters>
039.                <asp:SessionParameter DefaultValue="tr-TR" Name="SAYFA" SessionField="userLang"
040.                    Type="String" />
041.            </SelectParameters>
042.        </asp:SqlDataSource>
043. 
044.        <asp:SqlDataSource ID="SqlDataSource4" runat="server"
045.            ConnectionString="<%$ ConnectionStrings:TYS20DEVConnectionString %>"
046.            SelectCommand="(select distinct t.TALEPNO ,t.ID from KULLANICIHAVUZ kh inner join HAVUZTALEP ht on (kh.HAVUZTANIMID=ht.HAVUZID) inner join TALEP t on (ht.TALEPID=t.ID) inner join TALEPKULLANICI tk  on (tk.TALEPID=t.ID) where kh.KULLANICIID = @ID)">
047.            <SelectParameters>
048.                <asp:SessionParameter Name="ID" SessionField="tysUSER" Type="Object" />
049.            </SelectParameters>
050. 
051.        </asp:SqlDataSource>
052. 
053.        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdateInitiatorPanelsOnly="true">
054.            <AjaxSettings>
055.                <telerik:AjaxSetting AjaxControlID="radTalepTakipGrid">
056.                    <UpdatedControls>
057.                        <telerik:AjaxUpdatedControl ControlID="radTalepTakipGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
058.                    </UpdatedControls>
059.                </telerik:AjaxSetting>
060. 
061.                <telerik:AjaxSetting AjaxControlID="radSecilenKisiCombo">
062.                    <UpdatedControls>
063.                        <telerik:AjaxUpdatedControl ControlID="radTalepTakipGrid" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
064.                        <telerik:AjaxUpdatedControl ControlID="radSecilenKisiCombo" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
065.                    </UpdatedControls>
066.                </telerik:AjaxSetting>
067.            </AjaxSettings>
068. 
069.        </telerik:RadAjaxManager>
070.        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Sunset">
071.            <div class="loading">
072.                <asp:Image ID="loadingImg" runat="server" ImageUrl="~/Images/loading.gif" AlternateText="loading"></asp:Image>
073.            </div>
074.        </telerik:RadAjaxLoadingPanel>
075. 
076.        <telerik:RadComboBox ID="radSecilenKisiCombo" runat="server"
077.            AutoPostBack="True" Width="250px" Height="150px"
078.            AppendDataBoundItems="true"
079.            OnSelectedIndexChanged="radSecilenKisiCombo_SelectedIndexChanged" EmptyMessage="KiÅŸi seçiniz...">
080. 
081.            <ItemTemplate>
082.                <div class="imageWrap">
083.                    <telerik:RadBinaryImage runat="server" ID="Image1"  Width="32px" Height="32px" ResizeMode="Fit" DataValue='<%# Eval("KULLANICIFOTO")%>' />
084.                </div>
085.                <div>
086.                    <ul class="personDetails">
087.                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("AD")%>'></asp:Label>
088.                    </ul>
089.                </div>
090.            </ItemTemplate>
091.        </telerik:RadComboBox>
092.        <div class="gridPanel">
093.            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
094.                <telerik:RadGrid ID="radTalepTakipGrid" AllowPaging="true" PageSize="10"
095.                    AllowFilteringByColumn="True" AllowSorting="True"
096.                    runat="server" EnableLinqExpressions="False"
097.                    OnNeedDataSource="radTalepTakipGrid_NeedDataSource"
098.                    OnItemDataBound="radTalepTakipGrid_ItemDataBound"
099.                    OnItemCreated="radTalepTakipGrid_ItemCreated"
100.                    CssClass="RadGrid_gg RadGridRTL_gg">
101.                    <MasterTableView AutoGenerateColumns="false" ShowFooter="True" TableLayout="Fixed" DataKeyNames="ID" ClientDataKeyNames="ID">
102.                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
103.                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
104.                        <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
105.                        <Columns>
106.                            <telerik:GridHyperLinkColumn UniqueName="TALEPNO" DataNavigateUrlFormatString="TalepDetay.aspx?TID={0}" DataTextField="TALEPNO" DataNavigateUrlFields="ID" FilterControlWidth="90%" NavigateUrl="ID" HeaderText="TALEP NO"
107.                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
108.                                ShowFilterIcon="false">
109.                                <FilterTemplate>
110.                                    <telerik:RadAutoCompleteBox ID="radTalepNoBox" EmptyMessage="TALEP NO GİRİNİZ" DataSourceID="SqlDataSource4" DataTextField="TALEPNO" MaxResultCount="10"
111.                                        Width="90%" DataValueField="TALEPNO" OnEntryAdded="radTalepNoBox_EntryAdded" AutoPostBack="true" runat="server">
112.                                    </telerik:RadAutoCompleteBox>
113. 
114.                                </FilterTemplate>
115.                            </telerik:GridHyperLinkColumn>
116.                            <telerik:GridBoundColumn FilterControlWidth="90px" DataField="KATEGORI" UniqueName="KATEGORI" HeaderText="KATEGORI"
117.                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
118.                                ShowFilterIcon="false">
119.                                <FilterTemplate>
120.                                    <telerik:RadDropDownTree ID="radKATEGORItree" runat="server" DefaultMessage="Seçiniz.." Width="130px"
121.                                        OnEntryAdded="radKATEGORItree_EntryAdded" ExpandNodeOnSingleClick="false" EnableFiltering="true" FilterSettings-Highlight="Matches" FilterSettings-EmptyMessage="Kategori Seçiniz.. ">
122.                                        <DropDownSettings AutoWidth="Enabled" />
123.                                    </telerik:RadDropDownTree>
124.                                    <telerik:RadButton ID="radKategoriFilterButton" Text="Seç" ImageUrl="<%#GetFilterIcon() %>" ImagePosition="center" runat="server" OnClick="radKategoriFilterButton_Click">
125.                                    </telerik:RadButton>
126. 
127.                                </FilterTemplate>
128.                            </telerik:GridBoundColumn>
129.                            <telerik:GridBoundColumn FilterControlWidth="90%" UniqueName="ACILIYETDERECESI" DataField="ACILIYETDERECESI" HeaderText="ACILIYET DERECESI"
130.                                CurrentFilterFunction="Contains"
131.                                ShowFilterIcon="false">
132.                                <FilterTemplate>
133.                                    <telerik:RadComboBox ID="radACILIYETDERECESICombo" Width="100%" AutoPostBack="true" EmptyMessage="seçiniz" OnSelectedIndexChanged="radACILIYETDERECESICombo_SelectedIndexChanged"
134.                                        runat="server">
135.                                    </telerik:RadComboBox>
136.                                </FilterTemplate>
137. 
138.                            </telerik:GridBoundColumn>
139.                            <telerik:GridBoundColumn FilterControlWidth="90%" UniqueName="ACIKLAMA" DataField="ACIKLAMA" HeaderText="AÇIKLAMA" AutoPostBackOnFilter="true" ShowFilterIcon="true">
140.                            </telerik:GridBoundColumn>
141.                            <telerik:GridBoundColumn FilterControlWidth="90%" UniqueName="ISLEMDURUMU" DataField="ISLEMDURUMU" HeaderText="ISLEM DURUMU"
142.                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
143.                                ShowFilterIcon="false">
144.                                <FilterTemplate>
145.                                    <telerik:RadComboBox ID="radISLEMDURUMUCombo" Width="100%" runat="server" EmptyMessage="seçiniz" AutoPostBack="true" OnSelectedIndexChanged="radISLEMDURUMUCombo_SelectedIndexChanged">
146.                                    </telerik:RadComboBox>
147.                                </FilterTemplate>
148.                            </telerik:GridBoundColumn>
149.                            <telerik:GridDateTimeColumn DataField="TALEPACILISTARIHI" HeaderText="TALEP ACILIS TARIHI" FilterControlWidth="90%"
150.                                SortExpression="TALEPACILISTARIHI" PickerType="DatePicker" EnableTimeIndependentFiltering="true" ShowFilterIcon="true"
151.                                DataFormatString="{0:dd/MM/yyyy}">
152.                            </telerik:GridDateTimeColumn>
153. 
154.                        </Columns>
155. 
156.                        <NestedViewSettings>
157.                        <ParentTableRelation >
158.                            <telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" />
159.                        </ParentTableRelation>
160.                    </NestedViewSettings>
161. 
162.                        <NestedViewTemplate>
163.                            <div style="height: 150px; width: 100%">
164.                                <div style="width: 100%; height: 60%">
165.                                    <div style="float: left; padding-left: 3%; width: 25%; height: 100%">
166.                                        <div style="float: left;">
167.                                           <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1"  Width="64px" Height="64px" ResizeMode="Fit" DataValue='<%# Eval("TALEPSAHIBIKULLANICIFOTO")%>' />
168.                                         
169.                                        </div>
170.                                        <div style="float: left; margin-left: 3%">
171.                                            <%# Eval("TALEPSAHIBI")%>
172.                                            <br />
173.                                            <%# Eval("TALEPSAHIBIFIRMA")%>
174.                                            <br />
175.                                            <%# Eval("TALEPSAHIBIDEPARTMAN")%>
176.                                            <br />
177.                                            <%# Eval("TALEPSAHIBIDEPARTMANGOREV")%>
178.                                        </div>
179.                                    </div>
180.                                    <div style="float: right; margin-left: 1%; width: 70%; height: 100%">
181.                                        <asp:Label ID="Label2" runat="server" Text=' <%# Eval("ID") %>' Visible="false"></asp:Label>
182.                                        <asp:Label ID="TalepNoLabel" runat="server" Text="Talep Numarası :" Font-Bold="true"></asp:Label>
183.                                        <%# Eval("TALEPNO") %>
184.                                        <br />
185.                                        <asp:Label ID="AciklamaLabel" runat="server" Text="Talep Açıklaması" Font-Bold="true"></asp:Label>
186.                                        <br />
187.                                        <%# Eval("ACIKLAMA") %>
188.                                    </div>
189.                                </div>
190.                                <div style="width: 100%; height: 40%">
191.                                    <telerik:RadGrid ID="radTalepSonHareketGrid" runat="server">
192.                                        <MasterTableView AutoGenerateColumns="True" ShowFooter="True" TableLayout="Fixed">
193.                                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
194.                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
195.                                            <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
196.                                        </MasterTableView>
197.                                    </telerik:RadGrid>
198.                                </div>
199.                            </div>
200. 
201. 
202.                        </NestedViewTemplate>
203.                    </MasterTableView>
204.                    <ClientSettings EnableRowHoverStyle="true">
205.                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
206.                    </ClientSettings>
207.                </telerik:RadGrid>
208.            </telerik:RadAjaxPanel>
209.        </div>
210.    </div>
211.</asp:Content>


NeedDataSource of Grid  And ItemCreated Func. Of Child.Grid 

01.protected void radTalepTakipGrid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
02.       {
03.           TYS20DEVEntities db = new TYS20DEVEntities();
04.           Guid secilenK = Guid.Parse(radSecilenKisiCombo.SelectedItem.Value.ToString());
05.           var tlp = (from t in db.TALEP
06.                      from th in db.HAVUZTALEP
07.                      from tk in db.TALEPKULLANICI
08.                      from kh in db.KULLANICIHAVUZ
09.                      from f in db.FOTO
10.                      where
11.                       (secilenK == Guid.Empty || t.TALEPSORUMLUSUKULLANICIID == secilenK || tk.KULLANICIID == secilenK) &&
12.                            t.ID == tk.TALEPID &&
13.                            tk.KULLANICIID == userID &&
14.                            kh.HAVUZTANIMID == th.HAVUZID &&
15.                            th.TALEPID == t.ID &&
16.                            t.TALEPSAHIBIKULLANICIID == f.FKID
17.                            && kh.KULLANICIID==tk.KULLANICIID
18.                      orderby t.TALEPNO descending
19.                      select new
20.                      {
21.                          ID = t.ID,
22.                          TALEPNO = t.TALEPNO,
23.                          TALEPACILISTARIHI = t.TALEPACILISTARIHI,
24.                          KATEGORI = t.KATEGORI.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER,
25.                          KATEGORIID = t.KATEGORIID,
26.                          TALEPSAHIBI = t.TALEPSAHIBIKULLANICI.AD + " " + t.TALEPSAHIBIKULLANICI.SOYAD,
27.                          TALEPSAHIBIFIRMA = t.TALEPSAHIBIKULLANICI.KURUM.AD,
28.                          TALEPSAHIBIDEPARTMAN = t.TALEPSAHIBIKULLANICI.KURUMDEPARTMAN.PARAMETRE.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER,
29.                          TALEPSAHIBIDEPARTMANGOREV = t.TALEPSAHIBIKULLANICI.DEPARTMANGOREV.PARAMETRE.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER,
30.                          TALEPSAHIBIKULLANICIFOTO = f.ICERIK,
31.                          ACILIYETDERECESI = t.ACILIYETDERECESI.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER,
32.                          BILDIRIMTURU = t.BILDIRIMTURU.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER,
33.                          ACIKLAMA = t.ACIKLAMA,
34.                          ACILIYETDERECESIID = t.ACILIYETDERECEID,
35.                          ISLEMDURUMU = t.ISLEMDURUM.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER,
36.                          KULLANICIACILIYETSEVIYESI = tk.PARAMETRE.CEVIRI.FirstOrDefault(p => p.DILID == userLang).DEGER
37.                      }).ToList().Distinct();
38. 
39.           radTalepTakipGrid.DataSource = tlp.ToList();
40.           (radTalepTakipGrid.MasterTableView.GetColumn("ACIKLAMA") as GridBoundColumn).AllowFiltering = false;
41.          
42.       }

 protected void radTalepTakipGrid_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                GridDataItem nestedItem = ((GridNestedViewItem)e.Item).ParentItem as GridDataItem;
                string dataKeyValue = nestedItem.GetDataKeyValue("ID").ToString();
                RadGrid radTalepSonHareketGrid = (e.Item.FindControl("radTalepSonHareketGrid") as RadGrid);

                Guid tID = Guid.Parse(dataKeyValue);

                TYS20DEVEntities ent = new TYS20DEVEntities();

                var sonhareket = (from th in ent.TALEPHAREKET
                                  where
                                  th.TALEPID == tID
                                  orderby th.TARIH descending
                                  select new
                                  {
                                      KAYNAK = (th.KAYNAKHAVUZ.HAVUZPARAMETRE.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER == null) ? th.KAYNAKKULLANICI.AD + "" + th.KAYNAKKULLANICI.SOYAD : th.KAYNAKHAVUZ.HAVUZPARAMETRE.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER + " / " + th.KAYNAKKULLANICI.AD + "" + th.KAYNAKKULLANICI.SOYAD,
                                      HEDEF = (th.HEDEFHAVUZ.HAVUZPARAMETRE.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER == null) ? th.HEDEFKULLANICI.AD + " " + th.HEDEFKULLANICI.SOYAD : th.HEDEFHAVUZ.HAVUZPARAMETRE.CEVIRI.FirstOrDefault(c => c.DILID == userLang).DEGER + " / " + th.HEDEFKULLANICI.AD + " " + th.HEDEFKULLANICI.SOYAD,
                                      TARIH = th.TARIH,
                                      ACIKLAMA = th.ACIKLAMA,
                                      TALEPDURUM = ent.CEVIRI.FirstOrDefault(c => c.PARAMETREID == th.TALEPDURUM && c.DILID == userLang).DEGER
                                  }).Take(1);
                radTalepSonHareketGrid.DataSource = sonhareket;
                radTalepSonHareketGrid.DataBind();
            }
        }





V S Ultimate 2013 Version 12.0.21005.1 .Net Framework 4.5 
zafer
Top achievements
Rank 1
 answered on 24 Jun 2014
1 answer
246 views
Hi

I have a Radwindow with a button.
I am opening that window through a button click in the parent window.
But when I cam clicking the button on the RAD Window it disappears, I have tried with RAD Ajax Pannel but it that case the values posted in the window from my parent page disappears. Is there any standard way to keep the rad window on postback also.

Code for showing the window in aspx.vb page:

Protected Sub cmd_Search_Ref_Doc_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles cmd_Search_Ref_Doc.Click



        MySql = "Select Txn_Type from Master_Inventory_Txn_Type WHERE type_id =" & txt_Doc_No_Req.Value

        Dim SearchDt As DataTable = ComFunc.GetData(MySql)

        Dim TextBoxComment As Label = DirectCast(Rad_Window_Ref_Doc.ContentContainer.FindControl("lbl_Document_Name"), Label)
        TextBoxComment.Text = SearchDt.Rows(0).Item("Txn_Type")

        Dim RadWindowGrid As RadGrid = DirectCast(Rad_Window_Ref_Doc.ContentContainer.FindControl("radGridDocument"), RadGrid)
        MySql = "Select Doc_No, Doc_Date from BL_Txn_Item_Journal WHERE Txn_Type =" & txt_Doc_No_Req.Value
        SearchDt = ComFunc.GetData(MySql)
        RadWindowGrid.DataSource = SearchDt
        RadWindowGrid.DataBind()

        Dim script As String = "function f(){$find(""" + Rad_Window_Ref_Doc.ClientID + """).show();Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)

    End Sub

Code for Rad Window in ASPX Page:

 <telerik:RadWindow ID="Rad_Window_Ref_Doc" runat="server" 
            Skin="Outlook" VisibleOnPageLoad="false" EnableViewState="false"
            Width="550" Height="300" Modal="True" ReloadOnShow="true" ShowContentDuringLoad="false"
            Behaviors="Close, Maximize, Move, Reload" BorderStyle="Solid" 
            Title="Reference Documents" VisibleStatusbar="False">
            
             <ContentTemplate>
                
                 
                    
                        <table width="500px" style="height:70px;">
                            <tr>
                                <td>
                                    Search Document type
                                </td>
                                <td>
                                    <asp:Label ID="lbl_Document_Name" Font-Bold="true" runat="server" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Document No
                                </td>
                                <td>
                                    <asp:TextBox ID="txt_Document_No" Width="200px" runat="server"></asp:TextBox> 
                                    <asp:ImageButton ID="cmd_Search_Document_No"  ImageUrl="~/Project/image/button/search-button.jpg" runat="server" />
                                </td>
                            </tr>
                    
                         </table>

                       
                

                 <telerik:RadGrid ID="radGridDocument" 
                        runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
                        AllowPaging="false" GridLines="None" ShowGroupPanel="true" Width="500" Skin="Outlook">
                        <PagerStyle Mode="NumericPages"></PagerStyle>
                        <ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true"></ClientSettings>
                        <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
                            <Pdf PageHeight="210mm" PageWidth="297mm" PageTopMargin="45mm">
                            </Pdf>
                        </ExportSettings>
       
        
                        <MasterTableView  DataKeyNames="Doc_No" AllowMultiColumnSorting="True" GroupLoadMode="Server">
           
                        <Columns>
                            <telerik:GridBoundColumn  DataField="Doc_No" HeaderText="Doc No" SortExpression="Doc_No" UniqueName="Doc_No" > 
                            <HeaderStyle Width="250px" HorizontalAlign="Center" />
                               <ItemStyle HorizontalAlign="Left" />
                           </telerik:GridBoundColumn>
                           <telerik:GridDateTimeColumn DataField="Doc_Date" HeaderText ="Date" 
                            UniqueName="Doc_Date" DataFormatString="{0:dd/MMM/yyyy}" PickerType="None"></telerik:GridDateTimeColumn>
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="ViewCh" Text="Select Challan"
                            UniqueName="SelectCH" ImageUrl="~/Project/image/RadControls/Grid/Skins/Default/Edit.gif"></telerik:GridButtonColumn>
                        </Columns>
                    </MasterTableView>
                    </telerik:RadGrid>
                   
            </ContentTemplate>
    </telerik:RadWindow>







Princy
Top achievements
Rank 2
 answered on 24 Jun 2014
5 answers
166 views
I am experiencing an error with dynamically loaded tabs and pageviews when I enable ScrollChildren.

When the page loads, I can click on any of the tabs and it dynamically loads each pageview just fine.  But once I scroll it throws up a big nasty exception:

"Unhandled exception at line 15, column 9936 in http://localhost:56040/Web/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsmDetail_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=3.5.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:eb198dbd-2212-44f6-bb15-882bde414f00:ea597d4b:b25378d2;Telerik.Web.UI,+Version=2013.3.1114.35,+Culture=neutral,+PublicKeyToken=121fae78165ba3d4:en-US:3e277e38-c51f-44dd-a424-df507d29c5b5:16e4e7cd:86526ba7:874f8ea2:f7645509:24ee1bba:1e771326:88144a7a:a7e79140:e330518b:8e6f0d33:6a6d718d:f46195d3:19620875:cda80b3:ed16cbdc:92fe8ea0:fa31b949:490a9d4e:bd8f85e4:11a04f7e:58366029:b7778d6c

0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: -38.960000000000036 is not a valid value for Int32."

I have not created a sample application that replicates the issue.  Any feedback would be appreciated!
VK
Top achievements
Rank 1
 answered on 23 Jun 2014
0 answers
111 views
I have two separate Date columns  on the same SQL Server table, Date column --(1) Name = rowView["Name"].ToString() and Date column -- (2)   Name = rowView["NameNew"].ToString() .  I want to compare the dates and if they not equal, than draw two separate line on the same chart. I can't seem to get it working, but I can draw one line at a time. Attached see mu code. Any help will be appreciated. Below is my code

 using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;
    using System.Data.SqlClient;
    using System.Data;
    using Telerik.Reporting.Charting;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Summary description for rptWaterfall.
    /// </summary>
    public partial class rptNewReport : Telerik.Reporting.Report
    {
        private Telerik.Reporting.Charting.ChartSeries _series;
        private Telerik.Reporting.Charting.ChartSeries _seriesNew;
        public rptNewReport ()
        {
            /// <summary>
            /// Required for telerik Reporting designer support
            /// </summary>
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        private void chart1_NeedDataSource(object sender, EventArgs e)
        {
            DataSet ds;
            Telerik.Reporting.Processing.Chart chart;
            DateTime stepDate;
            DateTime stepDateNew;
            string interval,  Name,  NameNew, pointLabel, pointLabelnew, interval2;
            int riskWeight, likeNew, idOld, step, stId;

            if (_series == null)
            {

                chart = sender as Telerik.Reporting.Processing.Chart;

                ds = CreateChartDataSet();

                DataView view = ds.Tables[0].DefaultView;

                Telerik.Reporting.Chart chartDef = (Telerik.Reporting.Chart)chart.ItemDefinition;
                _series = new Telerik.Reporting.Charting.ChartSeries();

                Name = string.Empty;
                

                SetXAxisRange(view);

                foreach (DataRowView rowView in view)
                {
                    staId = (int)rowView["ID"];
                    step = int.Parse(rowView["Step"].ToString());
                    riskWeight = (int)rowView["averageweight"];
                    interval = rowView["Interval"].ToString();
                    interval2 = rowView["IntervalNew"].ToString();
                    Name = rowView["Name"].ToString();
                    likelihood = (int)rowView["Likelihood"];
                    likeNew = (int)rowView["idOld"];                    

                    if (DateTime.TryParse(interval, out stepDate))
                        pointLabel = stepDate.ToString("MM/dd/yy");
                    else
                        pointLabel = string.Empty;                   


                    if (DateTime.TryParse(interval, out stepDate))
                    {
                        string str = null;                         
                        str += stepDate.ToString("MM/dd/yy");                         
                        pointLabel = str;
                    }
                    else
                        pointLabel = string.Empty;

                   

                    Telerik.Reporting.Charting.ChartSeriesItem seriesItem = CreateSeriesItem(pointLabel, averageweight, stId);

                    _series.AddItem(seriesItem);
                }

                if (string.IsNullOrEmpty(Name))
                    Name = "ESPN Report";

                _series.Appearance.LineSeriesAppearance.Color = Color.Cyan;
                _series.Name = Name;
                _series.Type = ChartSeriesType.Line;
                chart1.ChartTitle.TextBlock.Text = "New Report";
                chartDef.Series.Clear();
                chartDef.Series.Add(_series);
            }
            if (_seriesNew == null)
            {

                chart = sender as Telerik.Reporting.Processing.Chart;

                ds = CreateChartDataSet();
                DataView view2 = ds.Tables[0].DefaultView;

                Telerik.Reporting.Chart chartDefNew = (Telerik.Reporting.Chart)chart.ItemDefinition;
                _seriesNew = new Telerik.Reporting.Charting.ChartSeries();


                NameNew = string.Empty;
                SetXAxisRangeNew(view2);

                foreach (DataRowView rowView2 in view2)
                {
                    staId = (int)rowView["ID"];
                    step = int.Parse(rowView["Step"].ToString());
                    riskWeight = (int)rowView["averageweight"];
                    interval = rowView["Interval"].ToString();
                    interval2 = rowView["IntervalNew"].ToString();
                    Name = rowView["NameNew"].ToString();
                    likelihood = (int)rowView["Likelihood"];
                    likeNew = (int)rowView["idOld"];       


                    if (DateTime.TryParse(interval2, out stepDateNew) )
                    {
                        string strNew = null;
                        strNew += stepDateNew.ToString("MM/dd/yy");
                        pointLabelnew = strNew;
                    }
                    else
                        pointLabelnew = string.Empty;


                    Telerik.Reporting.Charting.ChartSeriesItem seriesItemNew = CreateSeriesItemNew(pointLabelnew,averageweight, stId);
                    _seriesNew.AddItem(seriesItemNew);
                }

                if (string.IsNullOrEmpty(NameNew))
                    NameNew = "New Report";

                _seriesNew.Appearance.LineSeriesAppearance.Color = Color.Black;
                _seriesNew.Name = NameNew;
                _seriesNew.Type = ChartSeriesType.Line;

                chart1.ChartTitle.TextBlock.Text = "New Chart Rport";
                chartDefNew.Series.Clear();
                chartDefNew.Series.Add(_seriesNew);



            }
        }

        private Telerik.Reporting.Charting.ChartSeriesItem CreateSeriesItem(string pointLabel, int riskWeight, int statusId)
        {
            Telerik.Reporting.Charting.ChartSeriesItem seriesItem = new Telerik.Reporting.Charting.ChartSeriesItem(averageweight, pointLabel);
            seriesItem.Label.TextBlock.Appearance.Corners.SetCornersType(Telerik.Reporting.Charting.Styles.CornerType.Round);
            seriesItem.Label.TextBlock.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;

            if (statusId == 1) 
            {
                seriesItem.Label.TextBlock.Appearance.FillStyle.MainColor = Color.White;
                seriesItem.Label.TextBlock.Appearance.TextProperties.Color = Color.Black;
            }
            else if (statusId == 2) 
            {
                seriesItem.Label.TextBlock.Appearance.FillStyle.MainColor = Color.Gray;
                seriesItem.Label.TextBlock.Appearance.TextProperties.Color = Color.Black;
            }
            else//Complete
            {
                seriesItem.Label.TextBlock.Appearance.FillStyle.MainColor = Color.Black;
                seriesItem.Label.TextBlock.Appearance.TextProperties.Color = Color.White;
            }

            return seriesItem;
        }

        private Telerik.Reporting.Charting.ChartSeriesItem CreateSeriesItemNew(string pointLabelnew,int riskWeight, int statusId)
        {
            Telerik.Reporting.Charting.ChartSeriesItem seriesItemNew = new Telerik.Reporting.Charting.ChartSeriesItem(riskWeight, pointLabelnew);
            seriesItemNew.Label.TextBlock.Appearance.Corners.SetCornersType(Telerik.Reporting.Charting.Styles.CornerType.Round);
            
            if (statusId == 1) 
            {
                seriesItemNew.Label.TextBlock.Appearance.FillStyle.MainColor = Color.Red;
                seriesItemNew.Label.TextBlock.Appearance.TextProperties.Color = Color.Black;
            }
            else if (statusId == 2) 
            {
                seriesItemNew.Label.TextBlock.Appearance.FillStyle.MainColor = Color.Gray;
                seriesItemNew.Label.TextBlock.Appearance.TextProperties.Color = Color.Black;
            }
            else 
            {
                seriesItemNew.Label.TextBlock.Appearance.FillStyle.MainColor = Color.Black;
                seriesItemNew.Label.TextBlock.Appearance.TextProperties.Color = Color.White;
            }

            return seriesItemNew;
        }


        private void SetXAxisRange(DataView view)
        {
            int interval, firstInterval, lastInterval, interval2;

            lastInterval = int.MinValue;
            firstInterval = int.MaxValue;

             
            foreach (DataRowView rowView in view)
            {
                if (int.TryParse(rowView["Step"].ToString(), out interval))
                {
                    if (interval > lastInterval)
                        lastInterval = interval;
                    if (interval < firstInterval)
                        firstInterval = interval;
                }
            }

            //Get min and max step in result set
            foreach (DataRowView rowView in view)
            {
                if (int.TryParse(rowView["Step"].ToString(), out interval2))
                {
                    if (interval2 > lastInterval)
                        lastInterval = interval2;
                    if (interval2 < firstInterval)
                        firstInterval = interval2;
                }
            }

            double start = firstInterval;
            double end = lastInterval;

            //Avoid divide by zero error
            if (view.Count > 0)
            {
                chart1.PlotArea.XAxis.AddRange(start, end, 1);
            }
        }


        private void SetXAxisRangeNew(DataView view2)
        {
            int interval2, firstInterval, lastInterval;

            lastInterval = int.MinValue;
            firstInterval = int.MaxValue;

            //Get min and max step in result set
            foreach (DataRowView rowView2 in view2)
            {
                if (int.TryParse(rowView2["Step"].ToString(), out interval2))
                {
                    if (interval2 > lastInterval)
                        lastInterval = interval2;
                    if (interval2 < firstInterval)
                        firstInterval = interval2;
                }
            }

            double start = firstInterval;
            double end = lastInterval;

            //Avoid divide by zero error
            if (view2.Count > 0)
            {


                chart1.PlotArea.XAxis.AddRange(start, end, 1);

            }
        }

Ebenezer
Top achievements
Rank 1
 asked on 23 Jun 2014
2 answers
140 views
We have a RadGrid setup in which we are rebuilding the columns each postback but want to support column reordering, so we are maintaining the OrderIndexes of the columns in a ViewState object.  This approach has been working:  In the ColumnsReorder server side event we load the saved OrderIndexes from viewstate and apply reordering based on the event's Source and Target, then save the modified OrderIndexes back into ViewState.  In PreRender, we apply the saved OrderIndexes to the columns (see below code) and the columns show up in the expected order.

However, we have one problem:  We have certain command columns that we do not want to be movable, so when the ColumnsReorder event fires and either the Source or Target is one of these command columns we cancel the event (e.Cancelled = true;).  Unfortunately, when we cancel the event the grid displays the columns in the default order even though we are still applying the saved OrderIndexes to the columns in PreRender:

// Called from OnPreRender.
    private void RestoreOrderIndexes()
    {
       
      // Load the OrderIndexes saved in ViewState.
      var columnOrder = (Dictionary<string, int>)this.ViewState["GridColumnOrder"];
      if (columnOrder == null)
        return;
 
      // Apply the OrderIndexes to the grid columns.
      foreach (string columnName in columnOrder.Keys)
      {
        var gridColumn = this.MasterTableView.Columns.FindByUniqueNameSafe(columnName);
        if (gridColumn != null)
          gridColumn.OrderIndex = columnOrder[columnName];
      }
 
    }

I've verified that the OrderIndexes are being applied to the columns even when the ColumnsReorder event is cancelled via our OnColumnsReorder method, but the grid is simply not rendered with the modified order.  It seems the OrderIndex settings are ignored when the ColumnsReorder event is cancelled.

If I don't cancel the event and simply return from the OnColumnsReorder method when a command column is specified, the command column gets moved client side even though the OrderIndex for the command column wasn't modified by our code.  Any subsequent column reordering after that will see the command column suddenly pop back into place because it wasn't actually moved in the OrderIndex viewstate collection.

Do you have any suggestions for this issue?
Luke
Top achievements
Rank 2
 answered on 23 Jun 2014
2 answers
373 views
I have encountered an error here where I am attempting to use the AutoPostBackOnFilter of a grid and it is throwing a Javascript error: 

Uncaught TypeError: Cannot read property '_filterOnKeyPressWithDelay' of null

I am creating the grid in code with no markup:

//Create the Rad Grid
Telerik.Web.UI.RadGrid tmpRadGrid = new Telerik.Web.UI.RadGrid();
tmpRadGrid.Init += new EventHandler(tmpRadGrid_Init);
tmpRadGrid.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(tmpRadGrid_NeedDataSource);
tmpRadGrid.SelectedIndexChanged += new EventHandler(tmpRadGrid_SelectedIndexChanged);
tmpRadGrid.MasterTableView.ExpandCollapseColumn.Visible = false;
tmpRadGrid.Width = Unit.Percentage(100);
tmpRadGrid.ID = "radGrid" + tabText;
tmpRadGrid.Skin = "Silk";
tmpRadGrid.AutoGenerateColumns = false;
tmpRadGrid.AllowFilteringByColumn = true;
tmpRadGrid.GroupingSettings.CaseSensitive = false;
tmpRadGrid.AllowSorting = true;
tmpRadGrid.ClientSettings.EnableRowHoverStyle = true;
tmpRadGrid.ClientSettings.Selecting.AllowRowSelect = true;
tmpRadGrid.ClientSettings.EnablePostBackOnRowClick = true;
tmpRadGrid.CellPadding = 0;
tmpRadGrid.CellSpacing = 0;
tmpRadGrid.AllowPaging = true;
tmpRadGrid.PageSize = 50;
tmpRadGrid.PagerStyle.AlwaysVisible = true;
 
//Create the columns
Telerik.Web.UI.GridTemplateColumn tmpCol_Name = new Telerik.Web.UI.GridTemplateColumn();
tmpCol_Name.ItemTemplate = new GridNameColumnTemplate();
tmpCol_Name.ItemStyle.Width = new Unit(150);
tmpCol_Name.ItemStyle.VerticalAlign = VerticalAlign.Top;
tmpCol_Name.HeaderText = "Name";
tmpCol_Name.DataField = "FullName";
tmpCol_Name.SortExpression = "FullName";
tmpCol_Name.UniqueName = "FullName";
tmpCol_Name.FilterDelay = 0;
tmpCol_Name.FilterControlWidth = Unit.Percentage(80);
tmpCol_Name.AutoPostBackOnFilter = true;
tmpCol_Name.CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
 
Telerik.Web.UI.GridBoundColumn tmpCol_Title = new Telerik.Web.UI.GridBoundColumn();
tmpCol_Title.ItemStyle.Width = new Unit(150);
tmpCol_Title.ItemStyle.VerticalAlign = VerticalAlign.Top;
tmpCol_Title.HeaderText = "Business Title";
tmpCol_Title.DataField = "Title";
tmpCol_Title.SortExpression = "Title";
tmpCol_Title.UniqueName = "Title";
tmpCol_Title.FilterDelay = 0;
tmpCol_Title.FilterControlWidth = Unit.Percentage(80);
tmpCol_Title.AutoPostBackOnFilter = true;
tmpCol_Title.CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
 
Telerik.Web.UI.GridTemplateColumn tmpCol_ContactInfo = new Telerik.Web.UI.GridTemplateColumn();
tmpCol_ContactInfo.ItemTemplate = new GridContactInfoColumnTemplate();
tmpCol_ContactInfo.ItemStyle.Width = new Unit(100);
tmpCol_ContactInfo.ItemStyle.VerticalAlign = VerticalAlign.Top;
tmpCol_ContactInfo.HeaderText = "Contact Information";
tmpCol_ContactInfo.DataField = "FullContactInfo";
tmpCol_ContactInfo.SortExpression = "FullContactInfo";
tmpCol_ContactInfo.UniqueName = "ContactInfo";
tmpCol_ContactInfo.FilterDelay = 0;
tmpCol_ContactInfo.FilterControlWidth = Unit.Percentage(80);
tmpCol_ContactInfo.AutoPostBackOnFilter = true;
tmpCol_ContactInfo.CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
 
Telerik.Web.UI.GridBoundColumn tmpCol_Location = new Telerik.Web.UI.GridBoundColumn();
tmpCol_Location.ItemStyle.Width = new Unit(70);
tmpCol_Location.ItemStyle.VerticalAlign = VerticalAlign.Top;
tmpCol_Location.FilterControlWidth = Unit.Percentage(60);
tmpCol_Location.DataField = "OfficeCode";
tmpCol_Location.HeaderText = "Office Code";
tmpCol_Location.SortExpression = "OfficeCode";
tmpCol_Location.UniqueName = "Office";
tmpCol_Location.FilterDelay = 0;
tmpCol_Location.AutoPostBackOnFilter = true;
tmpCol_Location.CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
 
//Add the columns to the grid
tmpRadGrid.MasterTableView.Columns.Add(tmpCol_Name);
tmpRadGrid.MasterTableView.Columns.Add(tmpCol_Title);
tmpRadGrid.MasterTableView.Columns.Add(tmpCol_ContactInfo);
tmpRadGrid.MasterTableView.Columns.Add(tmpCol_Location);
 
tmpRadGrid.DataSource = tmpLetterContacts;
tmpRadGrid.DataBind();

Some of the columns are templates with the following templates: 
class GridNameColumnTemplate : ITemplate
{
    public void InstantiateIn(Control container)
    {
        Literal lit = new Literal();
        lit.DataBinding += new EventHandler(lit_DataBinding);
        container.Controls.Add(lit);
    }
 
    public void lit_DataBinding(object sender, EventArgs e)
    {
        Literal l = (Literal)sender;
        Telerik.Web.UI.GridDataItem container = (Telerik.Web.UI.GridDataItem)l.NamingContainer;
        Directory_BO.Employee tmpEmp = (Directory_BO.Employee)container.DataItem;
        l.Text = "<table><tr><td style='border:none;vertical-align:top;padding:0 3px 0 0 !important;' width='45px;'><img width='45px' src='/controls/EmployeePhoto.ashx?img=thumb&id=" + tmpEmp.ID + "' /></td><td style='border:none;padding:0px;vertical-align:top;'>" + tmpEmp.FullName + "</td></tr></table>";
    }
}
 
class GridContactInfoColumnTemplate : ITemplate
{
    public void InstantiateIn(Control container)
    {
        Literal lit = new Literal();
        lit.DataBinding += new EventHandler(lit_DataBinding);
        container.Controls.Add(lit);
    }
 
    public void lit_DataBinding(object sender, EventArgs e)
    {
        Literal l = (Literal)sender;
        Telerik.Web.UI.GridDataItem container = (Telerik.Web.UI.GridDataItem)l.NamingContainer;
        Directory_BO.Employee tmpEmp = (Directory_BO.Employee)container.DataItem;
        l.Text = tmpEmp.FullContactInfo;
    }
}

What is causing this error?  Is there a way to correct this?  I need the filtering to occur on Enter press.

Thanks,

Chris

Pavlina
Telerik team
 answered on 23 Jun 2014
2 answers
104 views
I want to use C# classes to query the database and create a data table and then set it as my DataSource for my TileList. However, after some debugging it seems that TileList does not have a "OnNeedDataSource" attribute to run a method that will query the data table. I know that I can set the DataSourceID, but I prefer to do it via C# code. This is what it looks like

<telerik:RadTileList runat="server" ID="PurchaseTileList" Width="900px"
                TileRows="1"
                EnableDragAndDrop="True" 
                SelectionMode="None"
                OnTileDataBound="TileListPurchase_OnDataBound"
                OnNeedDataSource="TileListPurchase_NeedDataSource">
                <DataBindings>
                    <CommonTileBinding TileType="RadTextTile" Shape="Square" DataTitleTextField="ProductDescription" DataNameField="ProductID" />
                    <TilePeekTemplate>
                        <div class="productNamePeek"><%# DataBinder.Eval(Container.DataItem,"PName") %></div>
                    </TilePeekTemplate>
                </DataBindings>
                <Groups>
                    <telerik:TileGroup>
                        <telerik:RadTextTile runat="server" Shape="Square" Font-Size="18px" Font-Bold="true"
                             Text="Products">
                            <Title Text=""></Title>
                        </telerik:RadTextTile>
                    </telerik:TileGroup>
                </Groups>
            </telerik:RadTileList>

My TileListPurchase_NeedDataSource will set Data Source to a created DataTable (This, however, is never run)

and my TileListPurchase_OnDataBound currently doesn't do much seeing as I'm not sure how to set these values for the tile.
Jason
Top achievements
Rank 1
 answered on 23 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?