Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
177 views
hi..............
  i have face some problem when use the rad ajax manager in my application.
probem is that when some control get trigger upadate control take much more time . in application
suppose on changeindexing of drop down some other drop down is changeing  take more time , but same process or code write separately in application then code execute speedly ?

can any body tell me what problem in my logic



Iana Tsolova
Telerik team
 answered on 30 Jul 2009
1 answer
136 views
Hi,

I've a <Linkbutton> embedded in RAD Grid control. I want to map the eventhandler dynamically. 

Here is my code. What i'm trying to do here opening a pop-up dialog on clicking the link button, but, unfortunately the event for the control is not biding to the control!

protected void grd_ItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e) 
        { 
            try 
            { 
                if (e.Item is GridDataItem) 
                { 
                    GridDataItem grdItem = (GridDataItem)e.Item; 
 
                    LinkButton lnk1 = e.Item.FindControl("link1") as LinkButton; 
                    Label lbl1 = e.Item.FindControl("label1") as Label; 
                    lnk1.CommandArgument = lbl1.Text; 
                    lnk1.Click += new EventHandler(lnk1_Click); 
                } 
            } 
       } 

       protected void lnk1_Click(object sender, EventArgs e) 
        { 
            try 
            { 
                LinkButton lnkButton = sender as LinkButton; 
                string argument = lnkButton.CommandArgument; 
 
              Page.ClientScript.RegisterClientScriptBlock(string.Empty.GetType(), "showpopup", 
                    "OpenPopupPage('lnkbutton');", true); 
            } 
            catch (Exception ex) 
            { 
                lblErrorMessage.Text = ex.Message; 
            } 
        } 
 

Let me know what mistake i am doing here

Thanks in advance
Viswa
Vlad
Telerik team
 answered on 30 Jul 2009
3 answers
129 views
Hi,
Is it possible to use filtering RADGrid in Asp.net MVC inside a radpanel with AJAX. Can I use the same control as ASP.net web form control or there is a separate control for MVC framework.

Thanks in advance
Vlad
Telerik team
 answered on 30 Jul 2009
1 answer
114 views
Hi,
I am creating PIe chart, how can I remove its top, left, rigth, spaces.
Legend show on bottom.

I am sending you design code. please tell me how to remove extra spaces arround the chart. and
<telerik:RadChart ID="chartCaseSummaryProductWise" runat="server" Skin="Office2007" 
        AutoLayout="True" SeriesPalette="customPalette" SeriesOrientation="Vertical" 
        AutoTextWrap="false" AlternateText="status ratio" Height="450px"   
        Width="300px" 
        DefaultType="Pie" PlotArea-Appearance-Border-Visible="false" ChartTitle-Visible="false" 
         PlotArea-DataTable-Appearance-AutoTextWrap="True">  
        <CustomPalettes>  
            <cc1:Palette Name="customPalette">  
                <Items>  
                    <cc1:PaletteItem MainColor="White" SecondColor="LightCoral">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="#666666">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="Lavender">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="LightBlue">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="Red">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="Yellow">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="Violet">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="PaleTurquoise">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="AntiqueWhite">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="#000066">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="Khaki">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="#990099">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="#FFCC66">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="#CCCC00">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="Purple">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="#00FF00">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="Orange">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="DarkSalmon">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="PaleGoldenRod">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="MediumVioletRed">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="FireBrick">  
                    </cc1:PaletteItem>  
                    <cc1:PaletteItem MainColor="White" SecondColor="#CCCCCC">  
                    </cc1:PaletteItem>  
                </Items>  
            </cc1:Palette>  
        </CustomPalettes>  
        <Appearance Border-Visible="false"   
        Dimensions-Margins="0%, 0%, 0px, 0px" 
         Dimensions-Paddings="0px, 0px, 0px, 0px">  
        </Appearance>  
        <PlotArea>  
        <Appearance   Dimensions-Margins="10%, 10%, 10px, 10px" 
         Dimensions-Paddings="10px, 10px, 10px, 10px">  
          
        </Appearance>  
        </PlotArea>  
        <Legend Visible="true" Appearance-Border-Visible="false">  
              
            <Appearance Dimensions-Margins="0%, 0%, 0px, 0px"   
                        Dimensions-Paddings="0px, 0px, 7px, 0px" 
                        Position-AlignedPosition="BottomLeft" 
                        Overflow="Row" 
                        >  
                <ItemTextAppearance TextProperties-Color="Navy">  
                </ItemTextAppearance>  
                <ItemMarkerAppearance Figure="Ractangle" Border-Visible="true" Position-AlignedPosition="TopRight">  
                </ItemMarkerAppearance>  
                <Border Visible="False"></Border>  
            </Appearance>  
        </Legend>  
    </telerik:RadChart>  
 
 
 
 
 
Code :   
 protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!Page.IsPostBack)  
        {  
            BindCaseSummaryProductWise();  
            if (Session["SessionID"] != null)  
                SessionID = Convert.ToInt32(Session["SessionID"]);  
        }         
    }  
 
    private void BindCaseSummaryProductWise()  
    {  
        try 
        {  
            ChartSeries series = new ChartSeries("CaseProductStatus", ChartSeriesType.Pie);  
            series.DataYColumn = "total_cases";  
            series.DataXColumn = "case_product_name";  
 
            series.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;              
            //series.DefaultLabelValue = "#%";  
            chartCaseSummaryProductWise.ItemDataBound += new EventHandler<ChartItemDataBoundEventArgs>(chartCaseSummaryProductWise_ItemDataBound);  
            chartCaseSummaryProductWise.Series.Add(series);  
 
              
            objDashBoardWS = new DashBoardWS();  
            chartCaseSummaryProductWise.DataSource = objDashBoardWS.Get_CaseSummaryChart_ProductWise(SessionID);  
 
            chartCaseSummaryProductWise.DataBind();  
              
        }  
        catch (Exception ex)  
        {  
            LogMessage(ex, 1);  
            return;  
        }  
    }  
 
    void chartCaseSummaryProductWise_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)  
    {  
        e.SeriesItem.Name = (e.DataItem as DataRowView).Row[0].ToString();  
    }  
 
 
Can we create 3D charts.?

thanks with reagrds
Ves
Telerik team
 answered on 30 Jul 2009
1 answer
74 views
Hi,

I have a page that loads 3 User Controls. All user controls contains a grid + various other controls. I use a RadAjaxManager in the Page that loads the user controls, and I use RadAjaxManagerProxy in all of the user controls. At intial load of the page it does not display anything untill all of the user controls have finished loading. However when I do a search in a grid or any other thing for that specific user control it only does updates around this control. Is there a way to make the main page load one user control at the time?

What I want is for the page to load it's layout quickly, and then do the populating of the grid in the background sorta speak. Is there a way to obtain this functionality?

ASPX page:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="MyPimsR3Home.aspx.vb" Inherits="MyPimsR3Home" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<%@ Register src="MyResponsibilities.ascx" tagname="MyResponsibilities" tagprefix="uc1" %> 
<%@ Register src="MyActions.ascx" tagname="MyActions" tagprefix="uc2" %> 
<%@ Register src="MyRisks.ascx" tagname="MyRisks" tagprefix="uc3" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
    <title></title> 
    <script type="text/javascript" language="javascript" src="Javascript/MyPimsR3Home.js" ></script> 
    <style type="text/css"> 
        .gridFrame 
        { 
            border-right:#bbd7fa 1px solid; 
            border-left:#bbd7fa 1px solid; 
            border-bottom: #bbd7fa 1px solid; 
            height: 100%; 
        } 
        .titleBar{ color:#00538f;} 
        .collapseArrows {background: url(images/bullet_arrow_up.png) 1000px 50% no-repeat} 
        .bl {background: url(images/bl.gif) 0 100% no-repeat} 
        .br {background: url(images/br.gif) 100% 100% no-repeat} 
        .tl {background: url(images/tl.gif) 0 0 no-repeat #bbd7fa; cursor:pointer;} 
        .tr {background: url(images/tr.gif) 100% 0 no-repeat} 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" RequestQueueSize="1" EnableAJAX="true"> 
    </telerik:RadAjaxManager> 
    <table width='1030px' cellspacing='0'> 
        <tr> 
            <td id="cResponsibilitiesRow" title="Click to hide My Responsibilities" onclick="toggle(this)"> 
                <div class="tl"><div id="cResponsibilitiesArrow" class="collapseArrows"><div class="tr"> 
                   <span id="cMyResponsibilitiesLink" class="titleBar"> 
                    <b>&nbsp;&nbsp;&nbsp;&nbsp;My Responsibilities</b></span> 
                </div></div></div> 
            </td> 
       </tr> 
       <tr> 
            <td class="gridFrame"> 
                <table id="cResponsibilitiesTable" width='1030px'> 
                    <tr> 
                        <td> 
                            <uc1:MyResponsibilities ID="cMyResponsibilities" runat="server" Visible="false" /> 
                        </td> 
                    </tr> 
                </table>                 
            </td> 
        </tr> 
        <tr> 
            <td> 
                &nbsp; 
            </td> 
        </tr> 
        <tr> 
            <td id="cTasksRow" title="Click to hide My Tasks" onclick="toggle(this)"> 
                <div class="tl"><div id="cTasksArrow" class="collapseArrows"><div class="tr"> 
                    <span id="cMyTasksLink" class="titleBar"> 
                    <b>&nbsp;&nbsp;&nbsp;&nbsp;My Actions</b></span> 
                </div></div></div> 
            </td> 
        </tr> 
        <tr> 
            <td class="gridFrame">     
                <table id="cTasksTable" width='1030px'> 
                    <tr> 
                        <td> 
                            <uc2:MyActions ID="cMyActions" runat="server"/> 
                        </td> 
                    </tr> 
                </table>   
            </td> 
        </tr> 
        <tr> 
            <td> 
                &nbsp; 
            </td> 
        </tr> 
        <tr> 
            <td id="cRisksRow" title="Click to hide My Risks" onclick="toggle(this)"> 
                <div class="tl" ><div id="cRisksArrow" class="collapseArrows"><div class="tr"> 
                    <span id="cMyRisksLink" class="titleBar"> 
                    <b>&nbsp;&nbsp;&nbsp;&nbsp;My Risks</b></span> 
                </div></div></div> 
            </td> 
        </tr> 
        <tr> 
            <td class="gridFrame"> 
                <table id="cRisksTable" width='1030px'> 
                    <tr> 
                        <td> 
                            <uc3:MyRisks ID="cMyRisks" runat="server" /> 
                        </td> 
                    </tr> 
                </table>   
            </td> 
        </tr> 
        <tr> 
            <td> 
                <input id="cCurrentDomain" type="text" runat="server" style="display:none"/>        
            </td> 
        </tr> 
    </table> 
    </form> 
</body> 
</html> 
 

ASCX Page:
<%@ Control Language="VB" AutoEventWireup="true" CodeFile="MyResponsibilities.ascx.vb" Inherits="MyResponsibilities" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
 
<link href="Stylesheets/CustomGridStyle.css" rel="stylesheet" type="text/css" /> 
 
<telerik:RadAjaxManagerProxy ID="RespRadAjaxManagerProxy" runat="server"> 
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="ResponsibilitiesRadGrid"> 
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="ResponsibilitiesRadGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
<telerik:RadAjaxLoadingPanel ID="RespRadAjaxLoadingPanel1" runat="server" Transparency="30" IsSticky="True"> 
</telerik:RadAjaxLoadingPanel> 
<telerik:RadCodeBlock ID="RespRadCodeBlock1" runat="server"> 
    <script type="text/javascript"> 
    </script> 
</telerik:RadCodeBlock> 
<table style="width: 90%; height: 100%;"> 
    <tr> 
        <td> 
            <telerik:RadGrid ID="ResponsibilitiesRadGrid" PageSize="50" runat="server" Height="400px" BackColor="#CDE4FA" EnableViewState="false"> 
                <FooterStyle CssClass="GridFooter_Office2007"></FooterStyle>  
                <SelectedItemStyle CssClass="GridSelectedItemStyle" /> 
                <HeaderContextMenu Skin="Office2007" EnableTheming="True"> 
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                </HeaderContextMenu> 
                <MasterTableView> 
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </ExpandCollapseColumn> 
                    <AlternatingItemStyle CssClass="GridAltItemStyle" /> 
                </MasterTableView> 
                <ClientSettings> 
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true"> 
                    </Scrolling> 
                    <Selecting AllowRowSelect="true" /> 
                    <ClientEvents OnRowDblClick="respRowDblClick" /> 
                </ClientSettings> 
                <FilterMenu Skin="Office2007" EnableTheming="True"> 
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                </FilterMenu> 
            </telerik:RadGrid> 
        </td> 
    </tr> 
    <input id="hdnRespCurrentDomain" type="text" runat="server" style="display:none;"/> 
</table> 
<script language="javascript"> 
    startUpRespScript(); 
</script> 

Any help is much appreciated.

Thanks,

Trygve


Yavor
Telerik team
 answered on 30 Jul 2009
1 answer
139 views
Hello all,
I have done an example like the demo Grid / MS Excel/MS Word/CSV.
I only choose the checkbox of Export only data ,it's OK.
I choose both of checkboxes of Export only data and Ignore paging (exports all pages)  ,it's OK.
I choose none of the checkbox ,the word only one column of PermissionId and fulled the whole word,the permissionid'data all appeared and then the current page's permissionid'data ; the CSV's columns all fulled in the first column; the Excel has all the data (not one to one)and then the current page.
I only choose the Ignore paging (exports all pages) ,like i choose none,but the data more.


all of this ,the export to ExcelML doesn't relize. when i debug
if (e.Row.Cells.Count > 0)  
                {  
                  if (e.Row.Cells[0] != null && ((string)e.Row.Cells[0].Data.DataItem).Contains("U"))  
                    {  
                        e.Row.Cells[0].StyleValue = "MyCustomStyle";  
                    }                      
                } 

it can't come into it.

here is my code:
<head runat="server">  
 
    <title>Untitled Page</title> 
</head> 
<body > 
    <form id="form1" runat="server" > 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting>   
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting>   
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
    <asp:ScriptManager ID="ScriptManager" runat="server" /> 
     
            <asp:CheckBox ID="CheckBox1" Text="Export only data" runat="server"/>  
            <br /> 
            <asp:CheckBox ID="CheckBox2" Text="Ignore paging (exports all pages)" runat="server"/>  
            <br /> 
            <br />   
             
    <div> 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
            <script type="text/javascript">  
 
              
            function ShowEditForm(id, rowIndex)  
            {  
                var grid = $find("<%= RadGrid1.ClientID %>");  
                  
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();   
                grid.get_masterTableView().selectItem(rowControl, true);  
                          
                window.radopen("WebForm2.aspx?PermissionsId=" + id, "UserListDialog");  
                return false;   
            }  
            function ShowInsertForm()  
            {  
               window.radopen("WebForm2.aspx", "UserListDialog");  
               return false;  
            }  
            function refreshGrid(arg)  
            {  
             if(!arg)  
             {  
             $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");               
                }  
                else  
                {  
             $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");               
                }  
            }  
            function RowDblClick(sender, eventArgs)  
            {  
             window.radopen("WebForm2.aspx?PermissionsId=" + eventArgs.getDataKeyValue("PermissionsId"), "UserListDialog");  
            }  
            </script> 
        </telerik:RadCodeBlock>   
          
     
    <asp:Button ID="Button1" runat="server" Text="Export to Excel" Width="150px"   
            onclick="Button1_Click"  /> 
    <asp:Button ID="Button2"  Width="150px" Text="Export to Word"  runat="server"   
            onclick="Button2_Click"/>  
    <asp:Button ID="Button3"  Width="150px" Text="Export to CSV" runat="server"   
            onclick="Button3_Click"/>  
    <asp:Button ID="Button4"  Width="150px" Text="Export to ExcelML" runat="server"   
            onclick="Button4_Click"/>  
     
        <telerik:RadGrid   
              
                ID="RadGrid1"   
                runat="server"   
                AllowPaging="True" AllowFilteringByColumn="True" 
                Width="97%"   
               OnNeedDataSource="RadGrid1_NeedDataSource"   
               OnRowDataBound="GridView1_RowDataBound" 
               OnItemCreated="RadGrid1_ItemCreated"              
              OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated" 
          
            GridLines="None">  
            <ExportSettings IgnorePaging="False" Pdf-AllowAdd="False" Pdf-AllowPrinting="True" ExportOnlyData="False"  > 
            <Excel Format="Html"  /> 
              
      
            <Csv ColumnDelimiter="Colon" RowDelimiter="NewLine"  /> 
             <Pdf PageHeight="297mm" PageWidth="210mm" PageTitle="Permissions menu"  /> 
            </ExportSettings> 
                <PagerStyle Mode="NumericPages" /> 
                <MasterTableView   
                    AutoGenerateColumns="False"   
                    DataKeyNames="PermissionsId"   
                    ClientDataKeyNames="PermissionsId" 
                    Width="100%" 
                    CommandItemDisplay="Top"   
                    PageSize="5">  
                    <Columns> 
                        <telerik:GridBoundColumn   
                            DataField="PermissionsId"   
                            HeaderText="PermissionsId" 
                            ReadOnly="True"   
                            SortExpression="PermissionsId"   
                            UniqueName="PermissionsId" > 
                         
                        <FilterTemplate> 
                            <telerik:RadComboBox   
                            ID="RadComboBox1" DataTextField="PermissionsId" DataValueField="PermissionsId" DataSource="<%# DataBindPermissionsId() %>" 
                                AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("PermissionsId").CurrentFilterValue %>' 
                                runat="server" OnClientSelectedIndexChanged="PermissionsIdIndexChanged">  
                                <Items> 
                                    <telerik:RadComboBoxItem Text="All" /> 
                                </Items> 
                            </telerik:RadComboBox> 
                               <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">  
                                <script type="text/javascript">  
                                    function PermissionsIdIndexChanged(sender,args) {  
                       
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                        tableView.filter("PermissionsId",args.get_item().get_value(),"EqualTo");  
                                    }  
                                </script> 
                            </telerik:RadScriptBlock> 
                        </FilterTemplate> 
                         </telerik:GridBoundColumn> 
                          
                        <telerik:GridBoundColumn   
                            DataField="PermissionsName"   
                            HeaderText="PermissionsName"   
                            SortExpression="PermissionsName" 
                            UniqueName="PermissionsName">  
                       <FilterTemplate> 
                            <telerik:RadComboBox   
                            ID="RadComboBox2" DataTextField="PermissionsName" DataValueField="PermissionsName" DataSource="<%# DataBindPermissionsName() %>" 
                                AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("PermissionsName").CurrentFilterValue %>' 
                                runat="server" OnClientSelectedIndexChanged="PermissionsNameIndexChanged" EnableLoadOnDemand="True" Filter="StartsWith">  
                                <Items> 
                                    <telerik:RadComboBoxItem Text="All" /> 
                                </Items> 
                            </telerik:RadComboBox> 
                               <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">  
                                <script type="text/javascript">  
                                    function PermissionsNameIndexChanged(sender,args) {  
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                        tableView.filter("PermissionsName",args.get_item().get_value(),"EqualTo");  
                                    }  
                                </script> 
                            </telerik:RadScriptBlock> 
                        </FilterTemplate>       
                              
                              
                        </telerik:GridBoundColumn>   
                            
                 <telerik:GridBoundColumn   
                         DataField="PermissionsNo" HeaderText="PermissionsNo"   
                            SortExpression="PermissionsNo"    UniqueName="PermissionsNo" > 
                             <FilterTemplate> 
                            <telerik:RadComboBox ID="RadComboBox3" DataTextField="PermissionsNo" DataValueField="PermissionsNo" DataSource="<%# DataBindPermissionsNo() %>" 
                                AppendDataBoundItems="true"  SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("PermissionsNo").CurrentFilterValue %>' 
                                runat="server" OnClientSelectedIndexChanged="PermissionsNoIndexChanged">  
                                <Items> 
                                    <telerik:RadComboBoxItem Text="All" /> 
                                </Items> 
                            </telerik:RadComboBox> 
                            <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">  
                                <script type="text/javascript">  
                                    function PermissionsNoIndexChanged(sender,args) {  
                                        var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                        tableView.filter("PermissionsNo",args.get_item().get_value(),"EqualTo");  
                                    }  
                                </script> 
                            </telerik:RadScriptBlock> 
                        </FilterTemplate>           
                           <%--   <ItemTemplate>     
                             <img src='Image/<%# Eval("PermissionsNo") %>.gif' alt="" style="vertical-align:middle;margin-right:7px;"/>  
                              </ItemTemplate>     --%>              
                    </telerik:GridBoundColumn>   
 
                      
       <%--   <telerik:GridDateTimeColumn   
                   FilterControlWidth="120px" DataField="CreateDate" HeaderText="CreateDate" SortExpression="CreateDate"   
                        UniqueName="CreateDate" PickerType="DatePicker" DataFormatString="{0:D}" CurrentFilterFunction="Contains">  
                        <HeaderStyle Width="160px" /> 
                    </telerik:GridDateTimeColumn>--%> 
                                         
               <telerik:GridTemplateColumn   
                            UniqueName="TemplateEditColumn">  
                             <ItemTemplate>                                                              
                                <asp:Image ID="EditLink" ImageUrl="../Images/Write2.gif"  runat="server" /> 
                                  <%--  <img src='Image/<%# Eval("PermissionsNo") %>.gif' alt="" style="vertical-align:middle;margin-right:7px;"/><%# Eval("PermissionsNo")%>  --%>     
                  </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                  
                    </Columns> 
                    <CommandItemTemplate> 
                        <a href="#" onclick="return ShowInsertForm();">Add New Record</a> 
                    </CommandItemTemplate> 
                </MasterTableView> 
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">  
                    <Selecting AllowRowSelect="true" /> 
                    <ClientEvents OnRowDblClick="RowDblClick" /> 
                </ClientSettings> 
            </telerik:RadGrid> 
                           
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
                <Windows> 
                    <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="400px" 
                        Width="300px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" /> 
                </Windows> 
            </telerik:RadWindowManager> 
 
    </div> 
    </form> 
</body> 
and .cs
   
    public partial class WebForm1 : System.Web.UI.Page  
    {  
    
    PermissionsService pre = new PermissionsService();  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            
        }  
 
        protected TList<Permissions> DataBindPermissionsId()  
        {  
            return pre.GetAll();  
        }  
 
        protected TList<Permissions> DataBindPermissionsName()  
        {  
            return pre.GetAll();  
        }  
 
        protected TList<Permissions> DataBindPermissionsNo()  
        {  
            return pre.GetAll();  
        }  
 
 
        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            Siemens.BPM.Profile.Entities.TList<Permissions> PerEntities = new TList<Permissions>();  
           PerEntities = pre.GetAll();              
           this.RadGrid1.DataSource = pre.GetAll();  
             
        }       
 
   /*     protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                Image editLink = (Image)e.Item.FindControl("EditLink");  
                editLink.Attributes["href"] = "#";  
                editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PermissionsId"], e.Item.ItemIndex);  
            }  
        }  
    */  
 
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)  
        {  
            if (e.Argument == "Rebind")  
            {  
 
                RadGrid1.MasterTableView.SortExpressions.Clear();  
                RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                RadGrid1.Rebind();  
            }  
            else if (e.Argument == "RebindAndNavigate")  
            {  
                RadGrid1.MasterTableView.SortExpressions.Clear();  
                RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                RadGrid1RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;  
                RadGrid1.Rebind();  
            }  
        }  
 
        protected void Button1_Click(object sender, EventArgs e)  
        {  
            ConfigureExport();  
            RadGrid1.MasterTableView.ExportToExcel();  
        }  
 
        protected void Button2_Click(object sender, EventArgs e)  
        {  
            ConfigureExport();  
     
            RadGrid1.MasterTableView.ExportToWord();  
           
 
        }  
 
        protected void Button3_Click(object sender, EventArgs e)  
        {  
            ConfigureExport();  
              
            RadGrid1.MasterTableView.ExportToCSV();  
        }  
 
        protected void Button4_Click(object sender, EventArgs e)  
        {  
          ConfigureExport();  
            RadGrid1.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;  
            CheckBox1.Checked = true;  
            RadGrid1.ExportSettings.ExportOnlyData = true;  
            RadGrid1.MasterTableView.ExportToExcel();  
         
        }  
        bool isPdfExport = false;  
 
   /*   protected void RadGrid1_ExcelMLExportRowCreated(object source,Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e)  
        {  
           if (e.RowType ==Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowType.DataRow)  
            {  
                if (e.Row.Cells.Count > 0)  
                {  
                     
                    if (e.Row.Cells[0] != null && ((string)e.Row.Cells[0].Data.DataItem).Contains("U"))  
                    {  
                        e.Row.Cells[0].StyleValue = "MyCustomStyle";  
 
                    }  
                       
                }  
            }  
        }  
    */  
             
        protected void RadGrid1_ExcelMLExportStylesCreated(object source,Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLStyleCreatedArgs e)  
        {  
            foreach (Telerik.Web.UI.GridExcelBuilder.StyleElement style in e.Styles)  
            {  
                if (style.Id  == "headerStyle")  
                {  
                    style.FontStyle.Bold = true;  
                    style.FontStyle.Color = System.Drawing.Color.Gainsboro;  
                    style.InteriorStyle.Color = System.Drawing.Color.Wheat;  
                    style.InteriorStyle.Pattern =Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;  
                }  
                else if (style.Id == "itemStyle")  
                {  
                    style.InteriorStyle.Color = System.Drawing.Color.WhiteSmoke;  
                    style.InteriorStyle.Pattern =Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;  
                }  
                else if (style.Id == "alternatingItemStyle")  
                {  
                    style.InteriorStyle.Color = System.Drawing.Color.LightGray;  
                    style.InteriorStyle.Pattern =Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;  
                }  
            }  
 
            Telerik.Web.UI.GridExcelBuilder.StyleElement myStyle = new Telerik.Web.UI.GridExcelBuilder.StyleElement("MyCustomStyle");  
            myStyle.FontStyle.Bold = true;  
            myStyle.FontStyle.Italic = true;  
            myStyle.InteriorStyle.Color = System.Drawing.Color.Gray;  
            myStyle.InteriorStyle.Pattern =Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;  
            e.Styles.Add(myStyle);  
        }  
 
 
       public void ConfigureExport()                                                                                                                                 
       {  
            RadGrid1.ExportSettings.ExportOnlyData = CheckBox1.Checked;  
           RadGrid1.ExportSettings.IgnorePaging = CheckBox2.Checked;  
           
        }  
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)  
        {  
 
            GridViewRow row = e.Row;  
        }  
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (isPdfExport && e.Item is GridDataItem)  
            {  
                GridDataItem Item = (GridDataItem)e.Item;  
                Item["PermissionsId"].Style["text-align"] = "center"; // Set the style for column with uniquename FirstName     
            }  
        }    
 
         
      
 
    } 

Thanks!!!
Veli
Telerik team
 answered on 30 Jul 2009
1 answer
227 views
Hello

Are there any examples that show how to manually insert/update rows in a details table. I have found an example for how to do this manually to a master table but that involves saving the data source in view state. I can't imagine you could save all of the details tables for a grid in view state

Thanks
Princy
Top achievements
Rank 2
 answered on 30 Jul 2009
1 answer
388 views
Hi,

I want my RadGrid to be loaded in EditMode, e.g. first row should be edit mode when grid got loaded.

i tried
protected void RadGrid1_DataBound(object sender, EventArgs e)
{
RadGrid radGrid = sender as RadGrid;
if (!radGrid.Items[0].IsInEditMode)
{
radGrid .Items[0].Edit = true;
//radGrid.Rebind();  
}
}

but never loaded in edit mode.

Part 2 of the question, can we set focue to a given cell when it moves in edit mode.

thanks
virendra 
Princy
Top achievements
Rank 2
 answered on 30 Jul 2009
2 answers
193 views
Hi!

I have a DatePicker to filter in grid:

<telerik:GridDateTimeColumn  DataField="JoiningDate" HeaderText="JoiningDate" SortExpression="JoiningDate" UniqueName="JoiningDate" PickerType="DatePicker" DataFormatString="{0:yyyy-MM--dd}" ></telerik:GridDateTimeColumn> 

So how to make the DatePicker  into same format "{0:yyyy-MM--dd}" ?

situation like this:

JoiningDate 
-----------------------------
1/3/2007  (Filter here, selected date)
-----------------------------
2008-01-31
2008-10-01 
2008-01-01


Thanks!

Best Regards
Airad
Airad
Top achievements
Rank 1
 answered on 30 Jul 2009
2 answers
308 views
Hello I am using RadGrid ExpandCollapseColumn
but I am requested to mack all expand icons as expanded mode
any help?
Ihab
Top achievements
Rank 1
 answered on 29 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?