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

Using the standard browser dialog Is it possible to display a confirm dialog when closing the Radwindow?

Thanks,
JC
Shinu
Top achievements
Rank 2
 answered on 13 May 2013
1 answer
358 views
Hi, 
Im using Rad ListView in my application and everything was going great until I decided to add search functionality, the search was a success and it displays the records founded the problem is if the found records were in different pages see what happens once I go to another page is that it cancels the search somehow and it reloads all the original records
 this is my ListView
<telerik:RadListView ID="packageListView" runat="server"
               DataKeyNames="PackageID"
               ItemPlaceholderID="PackageContainer" AllowPaging="True"
               OnItemCommand="packageListView_ItemCommand"  OnNeedDataSource="packageListView_NeedDataSource">
               <LayoutTemplate>
                   <fieldset style="max-width: 946px;">
                       <legend>Package</legend>
                       <table cellpadding="0" cellspacing="0" width="100%">
                           <tr>
                               <td>
                                   <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="packageListView" PageSize="1" CssClass="pagerStyle">
                                       <Fields>
                                           <telerik:RadDataPagerButtonField FieldType="First"/>
                                           <telerik:RadDataPagerButtonField FieldType="Numeric"/>
                                           <telerik:RadDataPagerButtonField FieldType="NextLast" />
                                           <telerik:RadDataPagerPageSizeField PageSizeComboWidth="60" PageSizeText="Page Size: "/>
                                           <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go" TextBoxWidth="25" />
                                           <telerik:RadDataPagerTemplatePageField>
                                               <PagerTemplate>
                                                   <div style="float: right; padding-left: 50px;">
                                                       <b>Items
                                                          <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# (Container.Owner.TotalRowCount > 0)? Container.Owner.StartRowIndex + 1  : 0%>"></asp:Label>
                                                                       to
                                                                       <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# (Container.Owner.TotalRowCount > 0)? Container.Owner.StartRowIndex + Container.Owner.PageSize : 0 %>"></asp:Label>
                                                                       of
                                                                       <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>"></asp:Label>
                                                           <br />
                                                       </b>
                                                   </div>
                                                     
                                               </PagerTemplate>
                                           </telerik:RadDataPagerTemplatePageField>
                                       </Fields>
                                   </telerik:RadDataPager>
                                   
                               </td>
                           </tr>
                       </table>
                       <asp:PlaceHolder runat="server" ID="PackageContainer"></asp:PlaceHolder>
                       <div style="clear: both"></div>
                       <table style="width: 100%; margin-top: 5px;">
                           <tr>
                               <td style="width: 25%;">
                                   <asp:Button ID="btnInitInsert" runat="server" Text="Insert Package" OnClick="btnInitInsert_Click"/>   
                               </td>
                               <td style="text-align: right; width: 75%;">
                                   <asp:Label ID="lblSort1" runat="server" Text="Sort by:" AssociatedControlID="ddListSort" Style="padding-right: 5px;"></asp:Label>
                                   <telerik:RadComboBox ID="ddListSort" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddListSort_SelectedIndexChanged">
                                       <Items>
                                           <telerik:RadComboBoxItem Text="-Select Field to Sort" Value=""/>
                                           <telerik:RadComboBoxItem Text="Package Name" Value="CompanyName" />
                                           <telerik:RadComboBoxItem  Text="Price" Value="PricePerMonth"/>
                                           <telerik:RadComboBoxItem Text="Clear Sort" Value="ClearSort"/>
                                       </Items>
                                   </telerik:RadComboBox> 
                                   <asp:RadioButtonList runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" ID="rblSort" AutoPostBack="true" OnSelectedIndexChanged="rblSort_SelectedIndexChanged">
                                       <asp:ListItem Text="Ascending" Value="ASC" Selected="True"></asp:ListItem>
                                       <asp:ListItem Text="Descending" Value="DESC"></asp:ListItem>
                                   </asp:RadioButtonList>
                               </td>
                           </tr>
                       </table>
                   </fieldset>
               </LayoutTemplate>
               <ItemTemplate>
                   <!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
                                    in the tiles layout-->
                   <fieldset class="fieldset">
                       <legend>Package Name:
                          <%# Eval("PackageName") %> </legend>
                       <table cellpadding="0" cellspacing="0" style="height: 100%; width:100%;">
                           <tr>
                               <td>
                                  <table cellpadding="0" cellspacing="0" style="width: 95%">
                                   <tr>
                                       <td>
                                           <table cellpadding="0" cellspacing="0">
                                               <tr>
                                                   <td style="width:25%">
                                                     Description:
                                                   </td>
                                                   <td style="width: 50%">
                                                       <%# Eval("PackageDesc") %>
                                                   </td>
                                               </tr>
                                               <tr>
                                                   <td>
                                                       Price(per Month):
                                                   </td>
                                                   <td>
                                                       <%# Eval("PricePerMonth") %>
                                                   </td>
                                               </tr>
                                               <tr>
                                                   <td>
                                                       Discount:
                                                   </td>
                                                   <td>
                                                       <%# Eval("discountPercent") %>
                                                   </td>
                                               </tr>
                                               <tr>
                                                   <td>
                                                       Number of Images:
                                                   </td>
                                                   <td>
                                                       <%# Eval("NumOfImg") %>
                                                   </td>
                                               </tr>
                                               <tr>
                                                   <td>
                                                      Numbrt of GIF:
                                                   </td>
                                                   <td>
                                                       <%# Eval("NumOfGIF") %>
                                                   </td>
                                               </tr>
                                               <tr>
                                                   <td>
                                                       Number Of Flash:
                                                   </td>
                                                   <td>
                                                       <%# Eval("NumOfFlash") %>
                                                   </td>
                                               </tr>
                                               <tr>
                                                   <td>
                                                       Home Page Included(Yes/No)
                                                   </td>
                                                   <td>
                                                       <%# Eval("isHomePageIncluded") %>
                                                   </td>
                                               </tr>
                                           </table>
                                       </td>
                                   </tr>
                                  </table>
                               </td>
                           </tr>
                           <tr>
                               <td>
                                   <table style="width: 95%; margin-top: 30px">
                                       <tr>
                                           <td>
                                               <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" Width="70px"/>
                                           </td>
                                           <td style="text-align: right">
                                               <asp:Button ID="btnDelete" runat="server" Text="Delete" CommandName="Delete" Width="70px" OnClientClick="return confirm('Are you certain you want to delete?');"/>
                                           </td>
                                       </tr>
                                   </table>
                               </td>
                           </tr>
                       </table>
                   </fieldset>
               </ItemTemplate>
 
               <EditItemTemplate>
                   <!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
                   in the tiles layout-->
                   <fieldset class="fieldset">
                       <legend>
                           Package Name:
                           <asp:TextBox ID="txtPackageName" runat="server" Text='<%# Bind("PackageName") %>'></asp:TextBox>
                           <asp:RequiredFieldValidator ID="rvPackageName" runat="server" ControlToValidate="txtPackageName" ErrorMessage="Please Enter Package Name" Display="Dynamic"></asp:RequiredFieldValidator>
                       </legend>
                       <table cellpadding="0" cellspacing="0" style="height: 80%;" width="100%">
                           <tr>
                               <td>
                                   <table cellpadding="0" cellspacing="0" style="width: 95%; margin-bottom: 5px">
                                       <tr>
                                           <td>
                                               <table cellpadding="0" cellspacing="2">
                                                   <tr>
                                                       <td style="width: 25%">
                                                          Description:
                                                       </td>
                                                       <td>
                                                           <asp:TextBox ID="txtPackageDesc" runat="server" Text='<%# Bind("PackageDesc") %>' TextMode="MultiLine"></asp:TextBox>
                                                       </td>
                                                   </tr>
                                                   <tr>
                                                       <td>
                                                           Price(per Month):
                                                       </td>
                                                       <td>
                                                           <asp:TextBox ID="txtPricePerMonth" runat="server" Text='<%# Bind("PricePerMonth") %>'></asp:TextBox>
                                                           <asp:RequiredFieldValidator ID="rvPricePerMonth" runat="server" ControlToValidate="txtPricePerMonth" ErrorMessage="Please Enter the Package Price" Display="Dynamic"></asp:RequiredFieldValidator>
                                                       </td>
                                                   </tr>
                                                   <tr>
                                                       <td>
                                                           Discount:
                                                       </td>
                                                       <td>
                                                           <asp:TextBox ID="txtDiscountPercent" runat="server" Text='<%# Bind("DiscountPercent") %>'></asp:TextBox>
                                                           <asp:RequiredFieldValidator ID="rvDiscountPercent" runat="server" ControlToValidate="txtDiscountPercent" ErrorMessage="Please Enter Discount Value (min:0)" Display="Dynamic"></asp:RequiredFieldValidator>
                                                       </td>
                                                   </tr>
                                                    <tr>
                                                       <td>
                                                           Number of Images:
                                                       </td>
                                                       <td>
                                                           <asp:TextBox ID="txtNumOfImg" runat="server" Text='<%# Bind("NumOfImg") %>'></asp:TextBox>
                                                           <asp:RequiredFieldValidator ID="rvNumOfImg" runat="server" ControlToValidate="txtNumOfImg" ErrorMessage="Please Enter The Number of Images" Display="Dynamic"></asp:RequiredFieldValidator>
                                                       </td>
                                                   </tr>
                                                    <tr>
                                                       <td>
                                                           Number of GIF:
                                                       </td>
                                                       <td>
                                                           <asp:TextBox ID="txtNumOfGIF" runat="server" Text='<%# Bind("NumOfGIF") %>' TextMode="MultiLine"></asp:TextBox>
                                                           <asp:RequiredFieldValidator ID="rvNumOfGIF" runat="server" ControlToValidate="txtNumOfGIF" ErrorMessage="Please Enter The Nuber of GIF(s)" Display="Dynamic"></asp:RequiredFieldValidator>
                                                       </td>
                                                   </tr>
                                                   <tr>
                                                       <td>
                                                           Number of Flash:
                                                       </td>
                                                       <td>
                                                           <asp:TextBox ID="txtNumOfFlash" runat="server" Text='<%# Bind("NumOfFlash") %>'></asp:TextBox>
                                                           <asp:RequiredFieldValidator ID="rvNumOfFlash" runat="server" ControlToValidate="txtNumOfFlash" ErrorMessage="Please Enter The Number of Flash File(s)" Display="Dynamic"></asp:RequiredFieldValidator>
                                                       </td>
                                                   </tr>
                                                    <tr>
                                                       <td>
                                                           Home page Included(Yes/No):
                                                       </td>
                                                       <td>
                                                           <asp:CheckBox runat="server" ID="cbIsHomePageIncliuded" Checked='<%# Bind("isHomePageIncluded")%>' />
                                                       </td>
                                                   </tr>
                                               </table>
                                           </td>
                                          
                                       </tr>
                                       <tr>
                                           <td colspan="2">
                                           <div style="clear: both">
                                           </div>
                                           <div style="float: left; padding-left: 30%;">
                                               <asp:Button ID="btnUpdate" runat="server" Text="Update" CommandName="Update" /> 
                                               <asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"/>
                                           </div>
                                       </td>
                                    </tr>
                                   </table>
                               </td>
                           </tr>
                       </table>
                   </fieldset>
               </EditItemTemplate>
               <InsertItemTemplate>
               <!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
               in the tiles layout-->
               <fieldset class="fieldset" style="clear: left; width: 540px">
                   <legend>Package Name:
                       <asp:TextBox ID="txtPackageName" runat="server" Text='<%# Bind("PackageName") %>'></asp:TextBox>
                       <asp:RequiredFieldValidator ID="rvPackageNamee" runat="server" ControlToValidate="txtPackageName"
                           ErrorMessage="Please enter Package Name" Display="Dynamic"></asp:RequiredFieldValidator>
                    </legend>
               <table cellpadding="0" cellspacing="0" style="height: 80%;" width="100%">
                   <tr>
                       <td>
                           <table cellpadding="0" cellspacing="5" style="width: 95%; margin-bottom: 5px">
                               <tr>
                                   <td style="width: 25%">
                                       Description:
                                   </td>
                                   <td style="width: 75%">
                                       <asp:TextBox ID="txtPackageDesc" runat="server" Text='<%# Bind("PackageDesc") %>'></asp:TextBox>
                                       <asp:RequiredFieldValidator ID="rvPackageDesc" runat="server" ControlToValidate="txtPackageDesc" ErrorMessage="Please Enter Package Description" Display="Dynamic"></asp:RequiredFieldValidator>
                                   </td>
                               </tr>
                               <tr>
                                   <td>
                                       Price(per Month):
                                   </td>
                                   <td>
                                       <asp:TextBox ID="txtPricePerMonth" runat="server" Text='<%# Bind("PricePerMonth") %>'></asp:TextBox>
                                       <asp:RequiredFieldValidator ID="rvPricePerMonth" runat="server" ControlToValidate="txtPricePerMonth" ErrorMessage="Please Enter Package Price" Display="Dynamic"></asp:RequiredFieldValidator>
                                   </td>
                               </tr>
                               <tr>
                                   <td>
                                       Discount:
                                   </td>
                                   <td>
                                       <asp:TextBox ID="txtDiscountPercent" runat="server" Text='<%# Bind("DiscountPercent") %>'></asp:TextBox> 
                                       <asp:RequiredFieldValidator ID="rvDiscountPercent" runat="server" ControlToValidate="txtDiscountPercent" ErrorMessage="Please Enter Discount Value (min:0)" Display="Dynamic"></asp:RequiredFieldValidator>
                                   </td>
                               </tr>
                               <tr>
                                   <td>
                                     Number of Images:
                                   </td>
                                   <td>
                                       <asp:TextBox ID="txtNumOfImg" runat="server" Text='<%# Bind("NumOfImg") %>'></asp:TextBox> 
                                       <asp:RequiredFieldValidator ID="rvNumOfImg" runat="server" ControlToValidate="txtNumOfImg" ErrorMessage="Please Enter Number of Image(s)" Display="Dynamic"></asp:RequiredFieldValidator>
                                   </td>
                               </tr>
                               <tr>
                                    <td>
                                       Number of GIF:
                                   </td>
                                   <td>
                                       <asp:TextBox ID="txtNumOfGIF" runat="server" Text='<%# Bind("NumOfGIF") %>'></asp:TextBox> 
                                       <asp:RequiredFieldValidator ID="rvNumOfGIF" runat="server" ControlToValidate="txtNumOfGIF" ErrorMessage="Please Enter Number of GIF(s)" Display="Dynamic"></asp:RequiredFieldValidator>
                                   </td>
                               </tr>
 
                               <tr>
                                   <td>
                                       Number of Flash:
                                   </td>
                                   <td>
                                       <asp:TextBox ID="txtNumOfFlash" runat="server" Text='<%# Bind("NumOfFlash") %>'></asp:TextBox> 
                                       <asp:RequiredFieldValidator ID="rvNumOfFlash" runat="server" ControlToValidate="txtNumOfFlash" ErrorMessage="Please Enter Number of Flash File(s)" Display="Dynamic"></asp:RequiredFieldValidator>
                                   </td>
                               </tr>
                               <tr>
                                    <td>
                                      Home Page Included(Yes/No):
                                   </td>
                                   <td>
                                        <asp:CheckBox runat="server" ID="cbIsHomePageIncliuded" Checked='<%# Bind("isHomePageIncluded")%>' />
                                   </td>
                               </tr>        
                           </table>
                       </td>
                   </tr>
                    <tr>
                       <td colspan="2">
                           <div style="clear: both">
                           </div>
                           <div style="float: left; padding-left: 40%;">
                                <asp:Button ID="btnPerformInsert" runat="server" Text="Insert" CommandName="PerformInsert"></asp:Button>
                                <asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"> </asp:Button>
                           </div>
                       </td>
                   </tr>
               </table>
               </fieldset>
               </InsertItemTemplate>
               <EmptyDataTemplate>
                   <fieldset style="width: 800px">
                   <legend>Packages</legend>No records for Packages available.
                   </fieldset>
               </EmptyDataTemplate>
           </telerik:RadListView>
and here is the code of my search Button click event handler 
public void btn_Search_Click(object sendr, EventArgs e)
      {
          packageDBDataContext db = new packageDBDataContext();
          var query = from contact in db.Packages
                      where contact.PackageName.Contains(txtSearch.Text.Trim())
          select contact;
          packageListView.DataSource = query;
          packageListView.DataBind();
          
 
      }
Help please it is quite an annoying problem
Thanks in advance 
PS. : Sorry if the code seems a bit long :) it is just basic, only a lot of templates 
Eyup
Telerik team
 answered on 13 May 2013
1 answer
108 views
HI Team,
When I am trying to upload a file using RadAsyncUpload, the result is getting struck up at the end of the file. Please see the attached Image. 
Plamen
Telerik team
 answered on 13 May 2013
0 answers
77 views
Telerik Embedded skins are not apply for radcontrols in IE. For that Some expert told to add a Radstylesheetmanager to combine stylesheet request into single one.

if i add radstylesheetmanager like this

 string telerikAssembly= typeof(RadGrid).Assembly.FullName;
                    RadStyleSheetManager stylesheet = new RadStyleSheetManager();
                    
                    StyleSheetReference css1 = new StyleSheetReference();
                    css1.Assembly = telerikAssembly;
                    css1.Name = "Telerik.Web.UI.Skins.Telerik.Grid.Telerik.css";
                    stylesheet.StyleSheets.Add(css1);

                    StyleSheetReference css2 = new StyleSheetReference();
                    css2.Assembly = telerikAssembly;
                    css2.Name = "Telerik.Web.UI.Skins.Office2007.Grid.Office2007.css";
                    stylesheet.StyleSheets.Add(css2);
                    
                    StyleSheetReference css3 = new StyleSheetReference();
                    css3.Assembly = telerikAssembly;
                    css3.Name = "Telerik.Web.UI.Skins.Black.Grid.Black.css";
                    stylesheet.StyleSheets.Add(css3);
                    this.Page.Header.Controls.Add(stylesheet);



it doesn't work.
how can i solve this issue please help me to solve this issue.
Achuthan
Top achievements
Rank 1
 asked on 13 May 2013
0 answers
90 views
Telerik Embedded skins are not apply for radcontrols in IE. For that Some expert told to add a Radstylesheetmanager to combine stylesheet request into single one.

if i add radstylesheetmanager like this

 string telerikAssembly= typeof(RadGrid).Assembly.FullName;
                    RadStyleSheetManager stylesheet = new RadStyleSheetManager();
                    
                    StyleSheetReference css1 = new StyleSheetReference();
                    css1.Assembly = telerikAssembly;
                    css1.Name = "Telerik.Web.UI.Skins.Telerik.Grid.Telerik.css";
                    stylesheet.StyleSheets.Add(css1);

                    StyleSheetReference css2 = new StyleSheetReference();
                    css2.Assembly = telerikAssembly;
                    css2.Name = "Telerik.Web.UI.Skins.Office2007.Grid.Office2007.css";
                    stylesheet.StyleSheets.Add(css2);
                    
                    StyleSheetReference css3 = new StyleSheetReference();
                    css3.Assembly = telerikAssembly;
                    css3.Name = "Telerik.Web.UI.Skins.Black.Grid.Black.css";
                    stylesheet.StyleSheets.Add(css3);
                    this.Page.Header.Controls.Add(stylesheet);



it doesn't work.
how can i solve this issue please help me to solve this issue.
Achuthan
Top achievements
Rank 1
 asked on 13 May 2013
1 answer
310 views
I'm using RadGrid in a ascx control as presented below. I'm having problem with performance with Detail tables. Sometimes there more than one detail table attached to master table row and when I'm expanding hierarchy function Radgrid_DetailTableDataBind2 is called n-times (n detail tables). The worst thing is that between second and third (when there is 3 detail tables) call there is sometimes 10 second delay. Is there some way to improve performance ?

In first approach there was :
Radgrid.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
Radgrid.ClientSettings.ClientEvents.OnHierarchyExpanded = "OnHierarchyExpanded";
Radgrid.ClientSettings.ClientEvents.OnHierarchyCollapsed = "OnHierarchyCollapsed";
but function Radgrid_DetailTableDataBind2 on initialization was called n * Row (n - numer of detail tables, Row - visible rows on page), which was on 10 visible rows was even 40 times.

I'm attaching most important function. IntializeGrid() is called in  protected void Page_Init(object sender, EventArgs e).
IntializeGrid()
{
            Radgrid = new RadGrid();

            Radgrid.ItemEvent += new GridItemEventHandler(Radgrid_ItemEvent);
            Radgrid.Init += new EventHandler(Radgrid_Init);
            Radgrid.NeedDataSource += new GridNeedDataSourceEventHandler(Radgrid_NeedDataSource);
 
Radgrid.PreRender += new EventHandler(Radgrid_PreRender);
Radgrid.DetailTableDataBind += new GridDetailTableDataBindEventHandler(Radgrid_DetailTableDataBind2);
            Radgrid.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand;
 
...
}

protected void Radgrid_Init(object sender, EventArgs e)
{             
 Radgrid.ItemCommand += new GridCommandEventHandler(Radgrid_ItemCommand);
  
                Radgrid.MasterTableView.DetailTables.Clear();
                ArrayList Cols = (Session[IdOkna + this.ID + "MultiLayerMainCols"] as ArrayList);
                for (int i = 0; i < Cols.Count; i++)
                {
                    GridTableView tableViewLevel = new GridTableView(Radgrid);
                    tableViewLevel.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand;
                    tableViewLevel.AutoGenerateColumns = false;
  
                    string TableName = Cols[i].ToString();
                    try
                    {
                        MainCol = ((XmlDocument)Session[IdOkna + this.ID + "XML_Doc"]).SelectSingleNode("//columns/child::column[source='" + TableName + "']").SelectSingleNode("columns/child::column[editSync='s']").SelectSingleNode("source").InnerText;
                        XmlNode xg = (SubColumns[MainCol + "." + TableName] as XmlNode);
                        loadsubcolumns(tableViewLevel, xg);
                    }
                    catch
                    {
                        loadSameColumns(tableViewLevel);
                    }
                    Radgrid.MasterTableView.DetailTables.Add(tableViewLevel);
  
...
}

void Radgrid_PreRender(object sender, EventArgs e)
{
    if ((HttpContext.Current.Session[IdOkna + ID + "MultiLayerMainCols"] as ArrayList).Count != 1)
        indekser = 0;
 
    if (HttpContext.Current.Session[IdOkna + ID + "ExpandItems"] != null)
    {
 
        Hashtable table = (HttpContext.Current.Session[IdOkna + ID + "ExpandItems"] as Hashtable);
 
        foreach (int key in table.Keys)
        {
            Radgrid.MasterTableView.Items[key].Expanded = Convert.ToBoolean(table[key]);
 
           if ((HttpContext.Current.Session[IdOkna + ID + "MultiLayerMainCols"] as ArrayList).Count != 1)
                indekser = 0;
        }
    }
}

void Radgrid_DetailTableDataBind2(object source, GridDetailTableDataBindEventArgs e)
{
    GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
 
    int index = dataItem.ItemIndex;
 
    int HCount;
    string Stable;
    string SHIndex;
 
    int kolumny1, kolumny2;
 
    if (HttpContext.Current.Session[IdOkna + ID + "MultiLayerMainCols"] != null)
        HCount = (HttpContext.Current.Session[IdOkna + ID + "MultiLayerMainCols"] as ArrayList).Count;
    else HCount = 0;
 
    if (HttpContext.Current.Session[IdOkna + ID + "SHIndex"] != null)
        SHIndex = HttpContext.Current.Session[IdOkna + ID + "SHIndex"].ToString();
    else SHIndex = "0";
 
    if (HttpContext.Current.Session[IdOkna + ID + "Stable"] != null)
        Stable = HttpContext.Current.Session[IdOkna + ID + "Stable"].ToString();
    else
        Stable = "";
 
    kolumny1 = index * HCount + Int32.Parse(SHIndex);
 
    kolumny2 = index * HCount + indekser;
 
    if (kolumny1 != kolumny2 && HCount > 1)
        e.DetailTableView.Visible = false;
    else
    {
        e.DetailTableView.Visible = true;
 
        Hashtable hash = (HttpContext.Current.Session[IdOkna + ID + "SubColumns"] as Hashtable);
        string MainID = HttpContext.Current.Session[IdOkna + ID + "Synchro"].ToString();
        string StringTable = Stable;
        string ColumnID = "";
        if (Stable == "")
        {
            StringTable = (HttpContext.Current.Session[IdOkna + ID + "MultiLayerMainCols"] as ArrayList)[0].ToString();
            ColumnID = (HttpContext.Current.Session[IdOkna + ID + "XML_Doc"] as XmlDocument).SelectSingleNode("//column[source='" + StringTable + "']").SelectSingleNode("columns/column[editSync='s']").SelectSingleNode("source").InnerText.Trim();
        }
        else
            ColumnID = (HttpContext.Current.Session[IdOkna + ID + "XML_Doc"] as XmlDocument).SelectSingleNode("//column[source='" + Stable + "']").SelectSingleNode("columns/column[editSync='s']").SelectSingleNode("source").InnerText;
 
        string columns = "";
        XmlNode gn = (hash[ColumnID + "." + StringTable] as XmlNode);
        string LinkKey = ColumnID;
        if (gn.ParentNode.SelectSingleNode("editSync").InnerText == "d")
        {
            LinkKey = gn.ParentNode.SelectSingleNode("source").InnerText;
        }
        SQL_builder sql = (SQL_builder)HttpContext.Current.Session[IdOkna + ID + "sql"];
 
        string id = "";
        DataTable MainTable = (HttpContext.Current.Session[IdOkna + ID + "MainTable"] as DataTable);
        id = MainTable.Rows[index][LinkKey].ToString();
 
        if (gn.ParentNode.SelectSingleNode("type").InnerText == "t")
        {
            id = id.Insert(0, "'");
            id = id.Insert(id.Length, "'");
        }
 
 
        pb = (PolaczBroker)HttpContext.Current.Session[IdOkna + ID + "PolaczBroker"];
        bk = pb.BrokerKlient;
 
        string MyQuery = "";
        string ForeignKey = "";
        //set sort
        if (gn.Attributes["Sort"] != null)
            sql.SetMultiLayerOrderByClause(gn.Attributes["Sort"].Value);
        // set from
        sql.SetMultiLayerFromClause(StringTable);
 
        //set parameters from session as hashtable == compatibility so old WF will still be working
        if (HttpContext.Current.Session[IdOkna + ID + "MultiLayerParam"] != null)
        {
            Hashtable MultiParam = (HttpContext.Current.Session[IdOkna + ID + "MultiLayerParam"] as Hashtable);
            if (MultiParam.Contains(StringTable))
            {
                if ((MultiParam[StringTable] as Hashtable).ContainsKey("FromClauseParameters"))
                    sql.SetMultiLayerFromClauseParameters((MultiParam[StringTable] as Hashtable)["FromClauseParameters"].ToString());
                else
                    sql.SetMultiLayerFromClauseParameters("");
                if ((MultiParam[StringTable] as Hashtable).ContainsKey("WhereClause"))
                    sql.SetMultiLayerWhereClause((MultiParam[StringTable] as Hashtable)["WhereClause"].ToString());
                else
                    sql.SetMultiLayerWhereClause("");
            }
            else
            {
                sql.SetMultiLayerFromClauseParameters("");
                sql.SetMultiLayerWhereClause("");
            }
        }
        else
        {
            // new parameters from session and clear it if no session provided
            if (HttpContext.Current.Session[IdOkna + ID + StringTable + "SetMultiLayerWhereClause"] != null)
            {
                sql.SetMultiLayerWhereClause(HttpContext.Current.Session[IdOkna + ID + StringTable + "SetMultiLayerWhereClause"].ToString());
            }
            else
                sql.SetMultiLayerWhereClause("");
 
            if (HttpContext.Current.Session[IdOkna + ID + StringTable + "SetMultiLayerFromClauseParameters"] != null)
            {
                sql.SetMultiLayerFromClauseParameters(HttpContext.Current.Session[IdOkna + ID + StringTable + "SetMultiLayerFromClauseParameters"].ToString());
            }
            else
                sql.SetMultiLayerFromClauseParameters("");
 
            if (HttpContext.Current.Session[IdOkna + ID + StringTable + "SetMultiLayerFromClause"] != null)
            {
                sql.SetMultiLayerFromClause(HttpContext.Current.Session[IdOkna + ID + StringTable + "SetMultiLayerFromClause"].ToString());
            }
        }
 
        if ((gn.Attributes["Self"] != null) && (gn.Attributes["Self"].Value == "true"))
        {
            if (gn.SelectSingleNode("ForeignKey") != null)
                ForeignKey = gn.SelectSingleNode("ForeignKey").InnerText;
            else
                ForeignKey = ColumnID;
 
            sql.SetMultiLayerColumns("");
        }
        else
        {
            kf = (Konfig)HttpContext.Current.Session[IdOkna + ID + "Konfig"];
            if (gn.Attributes["TypeServer"] != null)
                columns = kf.getColumnList(gn, gn.Attributes["TypeServer"].Value);
            else
                columns = kf.getColumnList(gn, HttpContext.Current.Session[IdOkna + ID + "TypeServer"].ToString());
            sql.SetMultiLayerColumns(columns);
 
        }
 
        MyQuery = sql.getMultiLayerSqlScript(ForeignKey, id, "50");
 
        //get data
        DataTable table = new DataTable();
        if ((HttpContext.Current.Session[IdOkna + ID + "TypeServer"].ToString() == "ADS") ||
            ((gn.Attributes["TypeServer"] != null) && (gn.Attributes["TypeServer"].Value == "ADS")))
            table = (DataTable)bk.SQL_Broker_Query(pb.getBaza(), MyQuery, false).ZwrocDataSet().Tables[0];
        else
        {
            DataSet ds = new DataSet();
            Hashtable danebazy = bk.PRM_OneDataBase(pb.getBaza());
 
            string adresBazy = ((string[])(danebazy["DBAdres"]))[0]; //adres bazy
            string login = danebazy["DBLogin"].ToString();//login
            string password = danebazy["DBHaslo"].ToString();//hasÅ‚o
            string catalog = danebazy["DBNazwaBazy"].ToString();//nazwa bazy
 
            SqlConnection con = new SqlConnection("Data Source=" + adresBazy + ";User ID=" + login + "; Password=" + password + ";initial catalog=" + catalog + ";integrated security=false;");
 
            SqlDataAdapter adapter = new SqlDataAdapter(MyQuery, con);//("SELECT kat_id, isnull(parent_id,0) as parent_id, nazwa FROM [dbo].[" + subNode.SelectSingleNode("table").InnerText + "_DRZEWO_MAPA_WYSZ] where parent_id=" + id + " order by parent_id", con);
            con.Open();
 
            adapter.Fill(ds);
            con.Close();
            table = (DataTable)ds.Tables[0];
 
            //table = (DataTable)bk.SQL_Query(pb.getBaza(), MyQuery, false).Tables[0];
        }
 
       for (int i = 0; i < table.Rows.Count; i++)
            for (int j = 0; j < table.Columns.Count; j++)
            {
                if ((table.Rows[i][j].GetType().Name != "Decimal") && (table.Rows[i][j].GetType().Name != "Int64") && (table.Rows[i][j].GetType().Name != "Int32") && (table.Rows[i][j].GetType().Name != "Boolean") && (table.Rows[i][j].GetType().Name != "DBNull") && (table.Rows[i][j].GetType().Name != "DateTime") && (table.Rows[i][j].GetType().Name != "Double"))
                {
                    if (table.Columns[j].Caption != "MainRowID")
                    {
                        string strID = table.Columns[j].Caption + "_" + i + "_" + j;
 
                        string strMouseOver = " onmouseover=CreateTip(this.id,this.innerHTML,'" + table.Columns[j].Caption + "'," + i + ");";
 
                        string strMouseOut = " onmouseout='RemoveTip();'";
 
                        table.Rows[i][j] = "<span id='" + strID + "' " + strMouseOver + strMouseOut + " >" + table.Rows[i][j] + "</span>";
                    }
                }
            }
 
        e.DetailTableView.DataSource = table;
        HttpContext.Current.Session[IdOkna + ID + index + "SubTable"] = table;
    }
 
    indekser++;
    string[] trace = IdOkna.Split('^');
 
    System.Diagnostics.Debug.Write(DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + "." + DateTime.Now.Second.ToString() + "." + DateTime.Now.Millisecond.ToString() + " | ");
    System.Diagnostics.Debug.WriteLine(trace[2] + "-" + trace[3] + "-" + trace[1] + "-" + trace[0] + "Radgrid_DetailTableDataBind2 " + indekser);
}
If there's missing some code please give me a hint which function...
Thank you in advance
Marin
Telerik team
 answered on 13 May 2013
0 answers
93 views
Telerik Embedded skins are not apply for radcontrols in IE. For that Some expert told to add a Radstylesheetmanager to combine stylesheet request into single one.

if i add radstylesheetmanager like this

 string telerikAssembly= typeof(RadGrid).Assembly.FullName;
                    RadStyleSheetManager stylesheet = new RadStyleSheetManager();
                    
                    StyleSheetReference css1 = new StyleSheetReference();
                    css1.Assembly = telerikAssembly;
                    css1.Name = "Telerik.Web.UI.Skins.Telerik.Grid.Telerik.css";
                    stylesheet.StyleSheets.Add(css1);

                    StyleSheetReference css2 = new StyleSheetReference();
                    css2.Assembly = telerikAssembly;
                    css2.Name = "Telerik.Web.UI.Skins.Office2007.Grid.Office2007.css";
                    stylesheet.StyleSheets.Add(css2);
                    
                    StyleSheetReference css3 = new StyleSheetReference();
                    css3.Assembly = telerikAssembly;
                    css3.Name = "Telerik.Web.UI.Skins.Black.Grid.Black.css";
                    stylesheet.StyleSheets.Add(css3);
                    this.Page.Header.Controls.Add(stylesheet);



it doesn't work.
how can i solve this issue please help me to solve this issue.
Achuthan
Top achievements
Rank 1
 asked on 13 May 2013
0 answers
58 views
Telerik Embedded skins are not apply for radcontrols in IE. For that Some expert told to add a Radstylesheetmanager to combine stylesheet request into single one.

if i add radstylesheetmanager like this

 string telerikAssembly= typeof(RadGrid).Assembly.FullName;
                    RadStyleSheetManager stylesheet = new RadStyleSheetManager();
                    
                    StyleSheetReference css1 = new StyleSheetReference();
                    css1.Assembly = telerikAssembly;
                    css1.Name = "Telerik.Web.UI.Skins.Telerik.Grid.Telerik.css";
                    stylesheet.StyleSheets.Add(css1);

                    StyleSheetReference css2 = new StyleSheetReference();
                    css2.Assembly = telerikAssembly;
                    css2.Name = "Telerik.Web.UI.Skins.Office2007.Grid.Office2007.css";
                    stylesheet.StyleSheets.Add(css2);
                    
                    StyleSheetReference css3 = new StyleSheetReference();
                    css3.Assembly = telerikAssembly;
                    css3.Name = "Telerik.Web.UI.Skins.Black.Grid.Black.css";
                    stylesheet.StyleSheets.Add(css3);
                    this.Page.Header.Controls.Add(stylesheet);



it doesn't work.
how can i solve this issue please help me to solve this issue.
Sivakumar
Top achievements
Rank 1
 asked on 13 May 2013
5 answers
187 views
Hi
I have 4 nested user Control which are add to my default page at run time.(I mean in my default page,there is place holder ,which the first user control will be added to this at run time, and in this way i have the 4 usercontrol nested )
The Fourth UserControl Contains the Capcha, but it always returns false.
when i load my controls in init function the third user control wont be added , and otherwise when i add my controls in page_load function ,the capcha returns false,
How can i solve this?
any one knows?

Thank in advance
Ghazal
Slav
Telerik team
 answered on 13 May 2013
38 answers
654 views
Hi,

With the latest version of the controls (2011.2.712.40) I am experiencing a rather unusably slow typing response in one of my RadTextBoxes.  It is a multiline textbox, wtih a maxlength setting.  I am trying to get a test case together as this is a definite issue since changing from the Q1 2011 version of the controls, but it seems to only happen in very particular circumstances. 

Before I burn a lot of time trying to get a test case, has anyone else seen this issue?

Thanks.

Craig
Martin
Telerik team
 answered on 13 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?