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

How can I pass parameters to Lightbox from Radgrid Item_DataBound? I am trying to bind RadHtmlChart based on RadGrid DataKey value. Here is my code. Could you please let me know? I am not sure how to do this. I just upgraded our projects to new controls. Thanks for any help.


  <telerik:RadLightBox ID="RadLightBox1" runat="server" width="400px" height="350px">
    <Items>
        <telerik:RadLightBoxItem>
            <ItemTemplate>
                    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Transitions="true" Skin="Metro"
                                    OnClientSeriesClicked="OnClientChartClicked">
                                    <PlotArea>
                                        <Series>
                                            <telerik:PieSeries DataFieldY="total" NameField="office" ColorField="PartyColor"
                                                ExplodeField="IsExploded">
                                                <LabelsAppearance DataFormatString="{0}" >
                                                </LabelsAppearance>
                                            </telerik:PieSeries>
                                        </Series>
                                    </PlotArea>
                                </telerik:RadHtmlChart>
            </ItemTemplate>
            </telerik:RadLightBoxItem>
            </Items>
    </telerik:RadLightBox>



 <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GridLines="None"
                                Skin="Office2007" Width="600px" Style="height: auto;" OnItemDataBound="RadGrid1_ItemDataBound">
                                <MasterTableView ShowHeadersWhenNoRecords="true" DataKeyNames="type_id">
                                    <Columns>
                                        <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" DataField="Name"
                                            HeaderText="Name" ReadOnly="True" UniqueName="Name">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="count" HeaderText="Total" UniqueName="count">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridHyperLinkColumn Text="View Details" UniqueName="viewDeatils" />
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
Code behind
-----------------------------------------------
       protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                HyperLink link = (HyperLink)item["viewDeatils"].Controls[0];
                int index = item.ItemIndex;
               link.Attributes.Add("onclick", String.Format("ShowGraph('{0}');", item.GetDataKeyValue("type_id").ToString()));
            }

Javascript:
----------------------

     function ShowGraph() {
                var lightBox1 = $find('<%= RadLightBox1.ClientID %>');
                lightBox1.show();
            }


        }

Kostadin
Telerik team
 answered on 03 Dec 2013
6 answers
391 views
I am trying to paging for detail table in RadGrid. but when i click on page's it is getting back to grid bind.

My code is :-

  <telerik:RadGrid ID="rdSettings" runat="server" AllowPaging="true" width="100%" AutoGenerateColumns="false"
                        OnDetailTableDataBind="rdSettings_DetailTableDataBind" Skin="Metro" OnPageIndexChanged="rdSettings_PageIndexChanged" OnPageSizeChanged="rdSettings_PageSizeChanged" Visible="false">
                    <MasterTableView  DataKeyNames="Module">
                    <DetailTables>
                    <telerik:GridTableView Name="group" Width="100%" AutoGenerateColumns="false">
                      <Columns>
                        <telerik:GridTemplateColumn ItemStyle-Width="5%">
                           <ItemTemplate>
                                <asp:CheckBox ID="chkGroup" runat="server" AutoPostBack="true" OnCheckedChanged="chkGroup_CheckedChanged"/>
                          </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="groupname" UniqueName="groupname" HeaderText="Group" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridBoundColumn>
                      </Columns>
                    </telerik:GridTableView>
                    </DetailTables>
                         <Columns>
                            <telerik:GridTemplateColumn HeaderText="Select">
                                <HeaderTemplate>
                                    <asp:CheckBox ID="chkHeader" AutoPostBack="true" runat="server" OnCheckedChanged="chkHeader_CheckedChanged" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkmodule" runat="server" OnCheckedChanged="chkmodule_CheckedChanged" AutoPostBack="true" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="Module" UniqueName="Module" HeaderText="Module" ItemStyle-Width="85%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            </telerik:GridBoundColumn>
                         </Columns>
                    </MasterTableView>
                </telerik:RadGrid>



And Detail Table code is



protected void rdSettings_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) // Bind's the nested Grid for Page Settings
    {
        string groupname = "";
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
        switch (e.DetailTableView.Name)
        {
            case "group":
                {
                    groupname = dataItem.GetDataKeyValue("Module").ToString();
                    string sqlquery = "select distinct(groupname) from [dbo].[POColumns] where module= '" + groupname + "'";
                    SqlDataAdapter da = new SqlDataAdapter(sqlquery, ScrCon);
                    DataSet ds = new DataSet();
                    da.Fill(ds);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        e.DetailTableView.DataSource = ds;
                    }
                    break;
                }
        }
    }


Please help out what else i have to do get the paging in Detail Table
Raghunath
Top achievements
Rank 2
 answered on 03 Dec 2013
3 answers
122 views
I need to allow users to upload images and then do basic editing of them for crop, resize, gamma etc and being able to skew/deskew or de-trapezoid! them - is this functionality already in the RADImageEditor? If not would I be able to extend it easily to support skew or is it better to look at another SDK which has this as inherent functionality?

Thanks,
M
Vessy
Telerik team
 answered on 03 Dec 2013
2 answers
333 views
Hi, I am getting this error in Chrome (it's "unable to get property 'firstchild' of undefined or null reference" in IE) when trying to open a RadWindow as a result of a callback.
Subsequent calls of the same callback throw "Cannot read property 'style' of null".
In the callback there's a RadWindowManager.open(url, "popupwnd") that calls some JQuery which in turn definitely throws this error.

I tried every version from 2013.2.717 to the latest nightly build. It still works fine in version 2013.1.417, but I need to support IE11.

Any idea on how to fix or debug it?

Thanks
Solgenia
Top achievements
Rank 1
 answered on 03 Dec 2013
3 answers
210 views
I have a user control which contains a RadGrid and two RadDatePickers that let you choose the date range for the grid's data source. I've set up a submit button to trigger a partial postback to update the grid with data for the selected date parameters using a RadAjaxManager.

<telerik2012:RadAjaxManagerProxy ID="testAjaxManagerProxy" runat="server">
    <AjaxSettings>
        <telerik2012:AjaxSetting AjaxControlID="btnLoadHistory">
            <UpdatedControls>
                <telerik2012:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik2012:AjaxSetting>
    </AjaxSettings>
</telerik2012:RadAjaxManagerProxy>
 
    <asp:Panel ID="divSearch" runat="server" style="font: 9pt arial, tahoma">
        <span>From </span>
        <telerik2012:RadDatePicker ID="dpStartDate" runat="server">
        </telerik2012:RadDatePicker>
        <span>To </span>
        <telerik2012:RadDatePicker ID="dpEndDate" runat="server">
        </telerik2012:RadDatePicker>
        <asp:Button ID="btnLoadHistory" runat="server" Text="Go" CausesValidation="False"
            Style="vertical-align: bottom" />
         <asp:CompareValidator ID="CompareValidator1" runat="server"
            ErrorMessage="Invalid Date Range" ControlToCompare="dpEndDate"
            ControlToValidate="dpStartDate" Operator="LessThanEqual" Type="Date"></asp:CompareValidator>
    </asp:Panel>
 
    <telerik2012:RadGrid ID="RadGrid1" runat="server" ...

This user control is on a SharePoint 2007 page layout & master page. When debugging, I noticed the first time btnLoadHistory is pressed, the Page_Load event was occurring twice. The first time IsPostBack was true, the second time it was false. Using Fiddler, I found that when I press the button, it does the async postback (POST to the page) as you'd expect, when it gets the response, I see the RadGrid update, and then it immediately does a GET on the same page, hence the IsPostBack == false the second time. It only happens the first time after the page initially loads. After that I can click btnLoadHistory and only the expected postback occurs. Any ideas what's going on?
Marin
Telerik team
 answered on 03 Dec 2013
1 answer
56 views
i am creating tab by using tabstrip with scrolling for multitab .when multiple tab is created like for e.g consider the no. of tabs as 14. initially the scrolling appears but when i  am deleting tab from 14,13, and so on at a point like when i am at tab 8 after deleting the scrolling disappears along with the starting tabs i.e tab1,tab2,tab3. Scrolling disappearing at a point is right but the starting tabs are hidden which causes a problem.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

 

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <title></title>
    
    <link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
   <%-- <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />--%>
 
        <%--<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ScrollButtonsOptionsList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                   
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="PerTabScrollingCheckBox">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                 
                </UpdatedControls>
            </telerik:AjaxSetting>
           
        </AjaxSettings>
    </telerik:RadAjaxManager>--%>

    <div class="exampleWrapper">
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Width="400px" ScrollChildren="true" ScrollButtonsPosition="Middle" PerTabScrolling="true" ScrollPosition="0"
            SelectedIndex="0">
            <Tabs>
                <telerik:RadTab Text="Advanced">
                </telerik:RadTab>
                <telerik:RadTab Text="Automatic Updates">
                </telerik:RadTab>
                <telerik:RadTab Text="Remote">
                </telerik:RadTab>
                <telerik:RadTab Text="General">
                </telerik:RadTab>
                <telerik:RadTab Text="Computer Name">
                </telerik:RadTab>
                <telerik:RadTab Text="Hardware">
                </telerik:RadTab>
                <telerik:RadTab Text="System Restore">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>

    </div>
 
   
 
  <%--  <div style="clear: both;"></div>--%>
 
   
    
 
    </form>
</body>
</html>

my code behind file:

using Telerik.Web.UI;

    public partial class Default2 : System.Web.UI.Page
{
        protected void Page_Load(object sender, EventArgs e)
        {
            var tabTemplate = new TabTemplate();
            foreach (RadTab tab in RadTabStrip1.Tabs)
            {
                tabTemplate.InstantiateIn(tab);
            }

        }
        protected void ScrollButtonsOptionsList_SelectedIndexChanged(object sender, EventArgs e)
        {
           // RadTabStrip1.ScrollButtonsPosition = (TabStripScrollButtonsPosition)Enum.Parse(typeof(TabStripScrollButtonsPosition), ((RadioButtonList)sender).SelectedValue);
           
        }
 
        protected void PerTabScrollingCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            //RadTabStrip1.PerTabScrolling = ((CheckBox)sender).Checked;
            //RadTabStrip1.ScrollPosition = 0;
           
        }
        public class TabTemplate : ITemplate
        {
            public void InstantiateIn(Control container)
            {
                Label label1 = new Label();
                label1.ID = "ItemLabel";
                label1.Text = (container as RadTab).Text;
                container.Controls.Add(label1);
                ImageButton imgRemove = new ImageButton();
                imgRemove.Init += imgRemove_Init;
                imgRemove.ID = "ImageButton1";
                imgRemove.Width = Unit.Pixel(9);
                imgRemove.Height = Unit.Pixel(9);
                imgRemove.ImageUrl = "~/cut.png";
                container.Controls.Add(imgRemove);
            }
            void imgRemove_Init(object sender, EventArgs e)
            {
                ImageButton img = (ImageButton)sender;
                img.Click += imgRemove_Click;

            }

            void imgRemove_Click(object sender, ImageClickEventArgs e)
            {
                ImageButton img = (ImageButton)sender;
                RadTab tab = img.Parent as RadTab;

                tab.TabStrip.SelectedIndex = tab.Index - 1;
              
                tab.TabStrip.Tabs.Remove(tab);
            }
        }


        protected void ReorderTabsOnSelectCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            
        }
    }
Nencho
Telerik team
 answered on 03 Dec 2013
1 answer
86 views
hi
 i am creating tab by using tabstrip with scrolling for multitab .when multiple tab is created like for e.g consider the no. of tabs as 14. initially the scrolling appears but when i  am deleting tab from 14,13, and so on at a point like when i am at tab 8 after deleting the scrolling disappears along with the starting tabs i.e tab1,tab2,tab3. Scrolling disappearing at a point is right but the starting tabs are hidden which causes a problem. pls help me fast.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

 

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <title></title>
    
    <link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
   <%-- <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />--%>
 
        <%--<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ScrollButtonsOptionsList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                   
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="PerTabScrollingCheckBox">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                 
                </UpdatedControls>
            </telerik:AjaxSetting>
           
        </AjaxSettings>
    </telerik:RadAjaxManager>--%>

    <div class="exampleWrapper">
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Width="400px" ScrollChildren="true" ScrollButtonsPosition="Middle" PerTabScrolling="true" ScrollPosition="0"
            SelectedIndex="0">
            <Tabs>
                <telerik:RadTab Text="Advanced">
                </telerik:RadTab>
                <telerik:RadTab Text="Automatic Updates">
                </telerik:RadTab>
                <telerik:RadTab Text="Remote">
                </telerik:RadTab>
                <telerik:RadTab Text="General">
                </telerik:RadTab>
                <telerik:RadTab Text="Computer Name">
                </telerik:RadTab>
                <telerik:RadTab Text="Hardware">
                </telerik:RadTab>
                <telerik:RadTab Text="System Restore">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>

    </div>
 
   
 
  <%--  <div style="clear: both;"></div>--%>
 
   
    
 
    </form>
</body>
</html>

my code behind file:

using Telerik.Web.UI;

    public partial class Default2 : System.Web.UI.Page
{
        protected void Page_Load(object sender, EventArgs e)
        {
            var tabTemplate = new TabTemplate();
            foreach (RadTab tab in RadTabStrip1.Tabs)
            {
                tabTemplate.InstantiateIn(tab);
            }

        }
        protected void ScrollButtonsOptionsList_SelectedIndexChanged(object sender, EventArgs e)
        {
           // RadTabStrip1.ScrollButtonsPosition = (TabStripScrollButtonsPosition)Enum.Parse(typeof(TabStripScrollButtonsPosition), ((RadioButtonList)sender).SelectedValue);
           
        }
 
        protected void PerTabScrollingCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            //RadTabStrip1.PerTabScrolling = ((CheckBox)sender).Checked;
            //RadTabStrip1.ScrollPosition = 0;
           
        }
        public class TabTemplate : ITemplate
        {
            public void InstantiateIn(Control container)
            {
                Label label1 = new Label();
                label1.ID = "ItemLabel";
                label1.Text = (container as RadTab).Text;
                container.Controls.Add(label1);
                ImageButton imgRemove = new ImageButton();
                imgRemove.Init += imgRemove_Init;
                imgRemove.ID = "ImageButton1";
                imgRemove.Width = Unit.Pixel(9);
                imgRemove.Height = Unit.Pixel(9);
                imgRemove.ImageUrl = "~/cut.png";
                container.Controls.Add(imgRemove);
            }
            void imgRemove_Init(object sender, EventArgs e)
            {
                ImageButton img = (ImageButton)sender;
                img.Click += imgRemove_Click;

            }

            void imgRemove_Click(object sender, ImageClickEventArgs e)
            {
                ImageButton img = (ImageButton)sender;
                RadTab tab = img.Parent as RadTab;

                tab.TabStrip.SelectedIndex = tab.Index - 1;
               
                tab.TabStrip.Tabs.Remove(tab);
            }
        }


        protected void ReorderTabsOnSelectCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            
        }
    }


Nencho
Telerik team
 answered on 03 Dec 2013
1 answer
166 views
Hi,
i am using radsplitter but during page load it loads like (load1.png) and then load completely (load.png).
How can i avoid this.
and i dont want any lining for radsplitter , but only want radsplitbar line to clearly separate page in two parts
<telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" SplitBarsSize=".5" Width="100%"
           Orientation="Vertical" Skin="WebBlue"  OnClientLoad="RadSplitter1_OnClientLoad">
           <telerik:RadPane ID="LeftPane" runat="server" Width="200px" MaxWidth="300" ShowContentDuringLoad="false">
              <h1>
                   Hello World</h1
           </telerik:RadPane>
           <telerik:RadSplitBar ID="Radsplitbar1" runat="server">
           </telerik:RadSplitBar>
           <telerik:RadPane ID="MiddlePane1" runat="server" CssClass="contentPaneDecorator"
               ShowContentDuringLoad="false">
               <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
               </asp:ContentPlaceHolder>
           </telerik:RadPane>
       </telerik:RadSplitter>

Thanks
Dobromir
Telerik team
 answered on 03 Dec 2013
1 answer
68 views
Hi

I have ListView in my page. I have applied paging and filter on list. Once I apply filter and use pagging, it allows to me to access the next page (if I am at page#1 it allows to go to page 2 or 3 or so on) but If I try to come back (go to page# 1 from page# 2 or so) it doesn't change the paging and throws below JS error.

Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

I have seen this post related to same problem. I think that, we might be missing something. I have checked the demo on the site and it is working fine but in my case it is error out. Please assist.

Thanks.
Angel Petrov
Telerik team
 answered on 03 Dec 2013
1 answer
190 views
HI,

Is there any way to get the list of GridBoundColumn DataField or UniqueName value which are in Grouping panel list. My Requirement is to get the columns which are in grouping panel and save it in Database or any where so that later those columns i need to dynamically add to grouping panel.

Thanks and Regards,
Rajender.A
Kostadin
Telerik team
 answered on 03 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?