Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
59 views
I have to reuse the user controls I'm creating multiple times on a single page. This user control has a listbox and a button. On clicking the button, a radwindow opens and will send some value back to the caller on close. I have to identify the appropriate user control when the pop-up closes and populate the listbox with the value returned.I'm running into two issues here. One is the question posted, how do I identify calling user control from the pop-up. Second, is something wrong on my ajaxrequest code? Even if I hardcode values, the listbox does not get populated.

Parent.aspx

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>

<telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
</telerik:RadAjaxManager>

<telerik:radwindowmanager id="RadWindowManager1" reloadonshow="true" showcontentduringload="false" runat="server" behavior="Default" initialbehavior="None" ></telerik:radwindowmanager>

<div>
<uc:Control ID="Ctrl1" runat="server"></uc:Control >
<uc:Control ID="Ctrl2" runat="server"></uc:Control >
<uc:Control ID="Ctrl3" runat="server"></uc:Control >
</div>

UserControl.ascx

<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
<script type="text/javascript">
function foo() {
var oWnd = radOpen('PopUp.aspx', "Title");
oWnd.add_close(OnClientClose);
return false;
}

function OnClientClose(oWnd) {
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");

ajaxManager.ajaxRequest('Processed return value');
return false;
}
</script>
</telerik:RadCodeBlock>

<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ListBox">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ListBox" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>

<table>
<tr>
<td>
<asp:ListBox ID="ListBox" Width="100px" runat="server" />
</td>
<td>
<asp:Button ID="AddButton" runat="server" OnClientClick="return foo(); return false;" Text="Add" />
</td>
</tr>
</table>

UserControl.ascx.cs

protected void Page_Load(object sender, EventArgs e)
{
var manager = RadAjaxManager.GetCurrent(Page);

manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);
}

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
if (!string.IsNullOrEmpty(e.Argument))
{
ListBox.Items.Add(new RadListBoxItem(e.Argument));
//This code runs without error but does not populate the list box. I even tried to harcode the control ID against which this code should run. The code ran only for the required control but listbox was not populated.
}
}

Also, all the 3 user controls get executed on the postback. Is there a way to prevent it? It's been a while since I have dealt with user controls and telerik, so if I missed out on any crucial detail in the sample above, please let me know.I do have to use telerik but not necessarily ajaxrequest. I tried some javascript code from telerik demos to populate the listbox but that didn't work either.Any help/clues/directions appreciated
Marin Bratanov
Telerik team
 answered on 04 Mar 2015
1 answer
84 views
Are the UI for ASP.NET components responsive?  If so, any example or documentation on how to config that? 

Thanks.
Marin Bratanov
Telerik team
 answered on 04 Mar 2015
2 answers
146 views
A simple question, is the client event OnRowDataBound meant to fire when using server side binding with NeedDataSource?

For me it does not fire when using server side binding, only client side binding but I need the OnRowDataBound to work on server side binding when partially moving to client side coding and I cant think of a reason it shouldn't fire.

Cheers,
Christian
Angel Petrov
Telerik team
 answered on 04 Mar 2015
1 answer
196 views
Hello,

I have a radGrid that populates with groups. The group header displays the group header title and aggregate sum as expected but the group header text is not aligned under the column name. All the header text is aligned in the left side of the groupheader. My code for calculates the sum is this:

protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            RadGrid1.HeaderStyle.Font.Size = 10;
            RadGrid1.GroupHeaderItemStyle.Font.Size = 10; 
  
            GridGroupByExpression gridGroupByExpression1 = new GridGroupByExpression();
            GridGroupByField gridGroupByField1 = new GridGroupByField();
              
            gridGroupByField1.FieldName = "GroupName";
            gridGroupByField1.HeaderValueSeparator = " ";
  
            gridGroupByExpression1.SelectFields.Add(gridGroupByField1);
            gridGroupByExpression1.GroupByFields.Add(gridGroupByField1);
  
            GridGroupByField gridGroupByField3 = new GridGroupByField();
              
            foreach (totals tot in totalsList)
            {
                gridGroupByField3 = new GridGroupByField();
                gridGroupByField3.FieldName = tot.name;
                gridGroupByField3.HeaderText = " ";
                gridGroupByField3.HeaderValueSeparator = " ";
                gridGroupByField3.FormatString = " (Total: {0})";
                gridGroupByField3.Aggregate = GridAggregateFunction.Sum;
                gridGroupByExpression1.SelectFields.Add(gridGroupByField3);
            }
  
            RadGrid1.MasterTableView.GroupByExpressions.Add(gridGroupByExpression1);
        }

I need to align the sum under the column name inside the groupheader text.

Thank you

Konstantin Dikov
Telerik team
 answered on 04 Mar 2015
1 answer
424 views
Hello Telerik Team,

Im trying to make an email management using telerik with 3 Tier architecture in asp.Net.



I have created a master page. Then a web page using this master page. I have to show a grid which could display "From", "To", "Message", createdOn etc on the grid. I have attached edit and delete button through item template image button. I am using a panel below the RadGrid so that when i click on edit template button this panel will open. this panel contains label names and their corresponding text boxes.
Now when i click on edit template image button....the values from the corresponding row should be filled in the textboxes of the down panel.
But when i click on the edit template image button, the objects in between and that corresponding textbox 's object too have found (got assigned) the value (as i can check it through break functionality of visual studio) but the value is not displaying on that textbox.

And another problem is that nothing happens when i click on another paging option or pagesize. plz fix it too.

please help me in this way as soon as possible.

Im sending you the code of main.master, NTier.aspx & NTier.aspx.cs





<<---------------------------------Main.Master--------------------------------------->>



<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="Email_Management.Main" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>



<!DOCTYPE html>



<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>Email-Management</title>

    <link href="css/Header.css" rel="stylesheet" type="text/css" />

    <asp:ContentPlaceHolder ID="head" runat="server">

    </asp:ContentPlaceHolder>

</head>

<body>

    <form id="form1" runat="server">

        <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="360000"></asp:ScriptManager>



        <table class="table1">

            <tr>

                <td class="column1">

                    &nbsp;<img src="images/Xtlytics_Logo.png" class="logo-image"/>

                </td>

               

<td class="column2">&nbsp;<asp:Label ID="lblWel"

runat="server" Text="Welcome,"

CssClass="welcome-user"></asp:Label>

                   

<asp:Label ID="lblUsername" runat="server" Text=" "

CssClass="welcome-user bold-txt"></asp:Label>

                    <span class="Seprator">|</span>

                   

<asp:ImageButton ID="ImageButton1" runat="server" ToolTip="Logout"

OnClick="btnLogout" CssClass="logout-image"

ImageUrl="~/images/logout.png"/>

                </td>

            </tr>

        </table>



        <table width="100%">

            <tr>

                <td>

                    <telerik:RadMenu ID="Menu" runat="server" EnableSelection="true" Skin="Telerik">

                        <ExpandAnimation Type="OutQuart" Duration="300" />

                        <CollapseAnimation Type="OutQuart" Duration="300" />

                        <Items>

                            <telerik:RadMenuItem Text="Insurance">

                                <Items>



                                </Items>



                            </telerik:RadMenuItem>

                            <telerik:RadMenuItem Text="HealthCare" ExpandMode="ClientSide">

                                <Items>

                                    <telerik:RadMenuItem Text="Big Data Explorer"></telerik:RadMenuItem>

                                </Items>



                            </telerik:RadMenuItem>



                            <telerik:RadMenuItem Text="Social Media" ExpandMode="ClientSide">

                                <Items>

                                    <telerik:RadMenuItem Text="Company"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Competitor"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Product"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Efluencer"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Swot"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Name Perceptual"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Brand Association"></telerik:RadMenuItem>

                                </Items>

                            </telerik:RadMenuItem>

                            <telerik:RadMenuItem Text="Analysis">

                                <Items>

                                    <telerik:RadMenuItem Visible="true" Text="Report Designer">

                                        <Items>

                                            <telerik:RadMenuItem Text="Correlation Designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Clustering Designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Chart Designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Forecasting Designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Regression Designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Simulation Designer"></telerik:RadMenuItem>

                                           

<telerik:RadMenuItem Text="Predictive Model

Designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Tag cloud designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Entities Designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Topics designer"></telerik:RadMenuItem>

                                            <telerik:RadMenuItem Text="Data report designer"></telerik:RadMenuItem>

                                        </Items>

                                   </telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Dashbaord Designer" Visible="true">



                                    </telerik:RadMenuItem>

                                </Items>

                            </telerik:RadMenuItem>

                            <telerik:RadMenuItem Text="Report">

                                <Items>

                                    <telerik:RadMenuItem Text="Saved Reports"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Ad-Hoc Report"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Causation Clues"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Your DashBoard" ></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Predictive Reports"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Simulation Reports" ></telerik:RadMenuItem>

                                </Items>

                            </telerik:RadMenuItem>

                            <telerik:RadMenuItem Text="Dashboard">

                                <Items>



                                </Items>

                            </telerik:RadMenuItem>

                            <telerik:RadMenuItem Text="Manage">

                                <Items>

                                     <telerik:RadMenuItem Text="Alert"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Track"></telerik:RadMenuItem>

                                     <telerik:RadMenuItem Text="Engage"></telerik:RadMenuItem>  

                                    <telerik:RadMenuItem Text="Tasks"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Emails"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Notes"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="External Data"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Concept"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Change Password"></telerik:RadMenuItem>

                                    <telerik:RadMenuItem Text="Add Record"></telerik:RadMenuItem>

                                </Items>

                            </telerik:RadMenuItem>

                            <telerik:RadMenuItem Text="Admin">

                                <Items>

                                    

<telerik:RadMenuItem Visible="true" Text="Data Field

Management"></telerik:RadMenuItem>

                                    

<telerik:RadMenuItem Visible="true" Text="Data Processing

Reports"></telerik:RadMenuItem>

                                     <telerik:RadMenuItem Text="User Management"></telerik:RadMenuItem>

                                    

<telerik:RadMenuItem Visible="true" Text="Group

Management"></telerik:RadMenuItem>

                                     <telerik:RadMenuItem Text="Social Network Management"></telerik:RadMenuItem>

                                     <telerik:RadMenuItem Text="Social Data Feed Management"></telerik:RadMenuItem>

                                    

<telerik:RadMenuItem Visible="true" Text="Data

Modeler"></telerik:RadMenuItem>     



                                </Items>

                            </telerik:RadMenuItem>

                            <telerik:RadMenuItem Text="Super Admin" ExpandMode="ClientSide" ></telerik:RadMenuItem>

                        </Items>



                    </telerik:RadMenu>

                </td>

            </tr>

        </table>



        <div>

            <asp:Label ID="YouAreHere" runat="server" Text="You are here: Manage>>Emails"></asp:Label>

            

            

        </div>

    <div>

        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

        

        </asp:ContentPlaceHolder>

        

    </div>

    </form>

    <script type="text/javascript">

        function _destroyTree2(element) {

            if (element.nodeType === 1) {

                var childNodes = element.childNodes;

                for (var i = childNodes.length - 1; i >= 0; i--) {

                    var node = childNodes[i];

                    if (node.nodeType === 1) {

                        if (node.dispose && typeof (node.dispose) === "function") {

                            node.dispose();

                        }

                        else if (node.control && typeof (node.control.dispose) === "function") {

                            node.control.dispose();

                        }

                        var behaviors = Sys.UI.Behavior.getBehaviors(node);

                        for (var j = behaviors.length - 1; j >= 0; j--) {

                            behaviors[j].dispose();

                        }

                        this._destroyTree(node);

                    }

                }

            }

        }



        Sys.WebForms.PageRequestManager.getInstance()._destroyTree = _destroyTree2

    </script>



</body>

</html>













<<<-------------------------------------------------------------NTier.aspx------------------------------------------------------------------------------>>>>



<%@

Page Title="" Language="C#" MasterPageFile="~/Main.Master"

AutoEventWireup="true" CodeBehind="NTier.aspx.cs"

Inherits="Email_Management.NTier" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">





    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

        <AjaxSettings>

            <telerik:AjaxSetting AjaxControlID="NTierGrid">

                <UpdatedControls>

                    <telerik:AjaxUpdatedControl ControlID="NTierGrid"></telerik:AjaxUpdatedControl>

                </UpdatedControls>

            </telerik:AjaxSetting>

        </AjaxSettings>

    </telerik:RadAjaxManager>





 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="" />

  <div>

   <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">

    <div>

       <telerik:RadPanelBar ID="RadPanelBar" runat="server" Width="150%">

          <Items>

            <telerik:RadPanelItem Value="Grid" Text="EmailManagement" Expanded="true" runat="server">

                <Items>

                    <telerik:RadPanelItem Expanded="true" runat="server" Selected="true" Value="EmailGrid">

                        <ItemTemplate>      

                           

<telerik:RadGrid ID="NTierGrid" runat="server" AllowPaging="True"

AllowSorting="True" Skin="WebBlue" AllowMultiRowEdit="True"

GridLines="None"

                            Width="100%"

OnNeedDataSource="NTierGrid_NeedDataSource" 

AllowMultiRowSelection="True" OnItemCreated="NTierGrid_ItemCreated"

                           

OnItemDataBound="NTierGrid_ItemDataBound"

OnItemCommand="NTierGrid_ItemCommand"

OnPageIndexChanged="NTierGrid_PageIndexChanged"

OnPageSizeChanged="NTierGrid_PageSizeChanged">

                            <HeaderContextMenu>

                            </HeaderContextMenu>

                            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />

                            <ClientSettings>

                                <Selecting  AllowRowSelect="true"/>

                            </ClientSettings>

                           

<MasterTableView CommandItemDisplay="Top" AllowPaging="true"

AllowAutomaticDeletes="false" AllowAutomaticInserts="false"

AllowAutomaticUpdates="false"

                           

AllowSorting="true" FilterItemStyle-Height="10px"

FilterItemStyle-Width="100px" ShowHeadersWhenNoRecords="true">



                            <CommandItemTemplate>

                                <div style="height: 28px;">

                                    <asp:ImageButton ImageUrl="images/edit.png"

                                       

Style="margin-left: 4px; margin-top: 2px; width:20px; height:20px;

vertical-align: middle;" ID="btnEdit"

                                        runat="server" ToolTip="Edit" CausesValidation="False" />

                                    <asp:ImageButton ImageUrl="images/delete.png" OnClick="btnDelete_Click"

                                        Style="margin-left: 11px; margin-top: 2px; vertical-align: middle;" ID="btnDelete"

                                        runat="server" ToolTip="Delete" CausesValidation="False" />

                     

                                </div>

                            </CommandItemTemplate>

                

                            <Columns>

                               

<telerik:GridBoundColumn DataField="EmailId"

UniqueName="columnEmailId" HeaderTooltip="EmailId" HeaderText="ID"

Visible="false">

                                </telerik:GridBoundColumn>

                               

<telerik:GridBoundColumn DataField="FromAddress"

HeaderTooltip="EmailFrom" UniqueName="columnEmailFrom"

FilterControlWidth="70%" Visible="false">

                                    <HeaderStyle Width="150px" Height="15px" />

                                </telerik:GridBoundColumn>

                               

<telerik:GridBoundColumn DataField="Message"

HeaderTooltip="EmailMessage" UniqueName="columnEmailMessage"

FilterControlWidth="70%" Visible="false"

                                    HtmlEncode="true">

                                    <HeaderStyle Width="150px" Height="15px" />

                                </telerik:GridBoundColumn>

                               

<telerik:GridBoundColumn DataField="PriorityId"

HeaderTooltip="PriorityID" UniqueName="columnPriority"

Visible="false">

                                </telerik:GridBoundColumn>

                               

<telerik:GridBoundColumn DataField="CreatedBy"

HeaderTooltip="CreatedBy" UniqueName="columnCreatedBy"

Visible="false">

                                </telerik:GridBoundColumn>

                               

<telerik:GridBoundColumn DataField="ModifiedBy"

HeaderTooltip="ModifiedBy" UniqueName="columnModifiedBy"

Visible="false">

                                </telerik:GridBoundColumn>

                               

<telerik:GridBoundColumn DataField="ToAddresses"

HeaderTooltip="ToAddresses" UniqueName="columnToAddresses"

Visible="false">

                                </telerik:GridBoundColumn>

                               

<telerik:GridBoundColumn DataField="CompId" HeaderTooltip="CompId"

UniqueName="columnCompId" Visible="false">

                                </telerik:GridBoundColumn>

                               

<telerik:GridBoundColumn DataField="CreatedOn"

HeaderTooltip="CreatedOn" UniqueName="columnCreatedOn"

Visible="false">

                                </telerik:GridBoundColumn>



                               

<telerik:GridTemplateColumn UniqueName="ActionHeader"

HeaderText="Edit/Delete" HeaderTooltip="Edit/Delete"

AllowFiltering="false" HeaderStyle-Width="20px">

                                    <ItemTemplate>

                                        <asp:Panel ID="EditButtonPanel" runat="server" Width="72px">&nbsp;

                                           

<asp:ImageButton  ImageUrl="~/images/edit.png" style="width:20px;

height:20px" ToolTip="Edit" OnClick="btnEdit_Click" ID="EditButton"

runat="server" CausesValidation="false"/> &nbsp;&nbsp;

                                           

<asp:ImageButton  ImageUrl="~/images/delete.png" style="width:20px;

height:20px" ToolTip="Delete" ID="DeleteButton"

OnClick="DeleteButton_Click" runat="server"

CausesValidation="false"/>

                                        </asp:Panel>

                                    </ItemTemplate>

                                </telerik:GridTemplateColumn>

                            </Columns>

                

                        </MasterTableView>

                        <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">

                            <Selecting  AllowRowSelect="true"/>

                        </ClientSettings>

                    

                        </telerik:RadGrid>

                    </ItemTemplate>

                </telerik:RadPanelItem>

            </Items>

         </telerik:RadPanelItem>

         

<telerik:RadPanelItem Enabled="true" Visible="true" Expanded="true"

runat="server" Value="EmailMasterPanel" Text="Edit Email">

              <Items>

                  <telerik:RadPanelItem Enabled="true" Expanded="true" Value="EmailPanel">

                      <ItemTemplate>

                         

<div id="DivExternalForm" runat="server" style="border:1px solid

groove; background-color:#E8E8E8;">

                              <asp:Panel ID="pnlExternalForm" runat="server" Visible="true">

                                 <div>

                                    

<%--<asp:TextBox ID="MyTextBox" runat="server"

ClientIDMode="Static" CausesValidation="false" BackColor="Yellow"

BorderColor="Tomato" ToolTip="Your Text"></asp:TextBox>--%>

                                    <table style="border:0; margin-top:1px; width: 100%">

                                      

                                      <tr width="100%">

                                          <td width="20%">

                                              <asp:Label ID="LblEmailId" runat="server" Text="Emaild" ></asp:Label>

                                              

                                          </td>

                                      </tr>

                                      <tr>

                                          <td>

                                              <asp:Label ID="LblFromAddress" runat="server" Text="From"></asp:Label>

                                          </td>

                                          <td>

                                             

<asp:TextBox ID="TextBoxFromAddress" runat="server"

CausesValidation="false" ClientIDMode="Static"

Width="400px"></asp:TextBox>

                                             

<%--<telerik:RadTextBox ID="radTextBoxFromAddress"

CausesValidation="false" runat="server"

Width="400px"></telerik:RadTextBox>--%>

                                             

                                          </td>

                                      </tr>

                                      <tr width="100%">

                                          <td>

                                              <asp:Label ID="LblToAddress" runat="server" Text="To"></asp:Label>

                                          </td>

                                          <td>

                                             

<telerik:RadTextBox ID="radTextBoxToAddress" runat="server"

Width="400px"></telerik:RadTextBox>

                                          </td>

                                      </tr>



                                      <tr width="100%">

                                          <td>

                                              <asp:Label ID="LblSubject" runat="server" Text="Subject"></asp:Label>

                                          </td>

                                          <td>

                                             

<telerik:RadTextBox ID="radTextBoxSubject" runat="server"

Width="400px"></telerik:RadTextBox>

                                          </td>

                                      </tr>



                                      <tr width="100%">

                                          <td>

                                              <asp:Label ID="LblMessage" runat="server" Text="Message"></asp:Label>

                                          </td>

                                          <td>

                                             

<telerik:RadTextBox ID="radTextBoxMessage" runat="server"

Width="400px" Height="150px" Visible="false"

TextMode="MultiLine"></telerik:RadTextBox>

                                             

<telerik:RadEditor ID="radEditorMail" runat="server" Width="600px"

BackColor="White" AllowScripts="true"

                                                AutoResizeHeight="false" EnableResize="false" NewLineBr="true" >

                                                    <Tools>

                                                            <telerik:EditorToolGroup>

                                                                    <telerik:EditorSeparator Visible="true" />

                                                                    <telerik:EditorTool Name="Copy" Text="Copy" />

                                                                    <telerik:EditorTool Name="Print" Text="Print" />

                                                                    <telerik:EditorDropDown Name="FontName" />

                                                                   

<telerik:EditorTool Name="ConvertToUpper" Text="Convert to Upper

Case" />

                                                                   

<telerik:EditorTool Name="ConvertToLower" Text="Convert to Lower

Case" />

                                                                    <telerik:EditorTool Name="Bold" Text="Bold" />

                                                                    <telerik:EditorTool Name="Italic" Text="Italic" />

                                                                   

<telerik:EditorTool Name="Underline" Text="Underline" />

                                                                   

<telerik:EditorTool Name="JustifyLeft" Text="Align Left" />

                                                                   

<telerik:EditorTool Name="JustifyCenter" Text="Align Center" />

                                                                   

<telerik:EditorTool Name="JustifyRight" Text="Align Right" />

                                                                   

<telerik:EditorTool Name="InsertOrderedList" Text="Numbered List"

/>

                                                                   

<telerik:EditorTool Name="InsertUnorderedList" Text="Bullet List"

/>

                                                              

                                                                     

<telerik:EditorTool Name="LinkManager" Text="Link Manager" />

                                                                   

<telerik:EditorTool Name="JustifyFull" Text="justify" />

                                                                   

<telerik:EditorTool Name="ForeColor" Text="Foreground color" />

                                                                   

<telerik:EditorTool Name="AjaxSpellCheck" Text="Ajax Spell Checker"

/>

                                                                   

<telerik:EditorTool Name="Subscript" Text="Subscript" />

                                                                   

<telerik:EditorTool Name="Superscript" Text="Superscript" />

                                                                   

<telerik:EditorTool Name="BackColor" Text="BackColor" />

                                                                    <telerik:EditorTool Name="FontSize" Text="FontSize" />

                                                                    <telerik:EditorTool Name="Paste" Text="Paste" />

                                                                    <telerik:EditorTool Name="Cut" Text="Cut" />

                                                            </telerik:EditorToolGroup>

                                                   </Tools>

                                              </telerik:RadEditor>

                                          </td>

                                      </tr>

                                      <tr>

                                          <td>

                                             

<asp:Label ID="LblModifiedBy" runat="server" Text="Modified

By"></asp:Label>

                                          </td>

                                          <td>

                                             

<telerik:RadTextBox ID="radTextBoxModifiedBy" runat="server"

Width="300px"></telerik:RadTextBox>

                                          </td>

                                      </tr>



                                      

                                      <tr>

                                          <td>



                                          </td>

                                          <td>

                                             

<asp:ImageButton ID="btnSave" ImageUrl="images/save.png"

runat="server" OnClick="btnSave_Click" CausesValidation="false"

ToolTip="Save/Update"/>&nbsp;&nbsp;&nbsp;

                                             

<asp:ImageButton ID="btnCancel" ImageUrl="images/cancel.png"

runat="server" OnClick="btnCancel_Click" CausesValidation="false"

ToolTip="Cancel"/>

                                          </td>

                                      </tr>

                                  </table>

                                </div>



                              </asp:Panel>



                          </div>

                      </ItemTemplate>



                  </telerik:RadPanelItem>

              </Items>



          </telerik:RadPanelItem>  

        </Items>

           <CollapseAnimation Duration="100" Type="None"/>

           <ExpandAnimation Duration="100" Type="None" />

     </telerik:RadPanelBar>

    </div>



   </telerik:RadAjaxPanel>

  </div>



    

</asp:Content>







<<<<------------------------------------------------------------------NTier.aspx.cs--------------------------------------------------->>>>





using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using BusinessLayer;

using DataAccessLayer;

using System.Data;

using Telerik.Web.UI;



namespace Email_Management

{

    public partial class NTier : System.Web.UI.Page

    {

        EmailBL objEmailBL = new EmailBL();

        protected void Page_Load(object sender, EventArgs e)

        {

            //-----this is for Simple DataBinding---

            //DataTable dtEmail = objEmailBL.GetEmailData("119");

            //NTierGrid.DataSource = dtEmail as DataTable;

            //NTierGrid.DataBind();

            

           

        }



        public void BindData()

        {

            RadGrid radNTGrid = (RadGrid)RadPanelBar.FindItemByValue("EmailGrid").FindControl("NTierGrid");

            DataTable ds = new DataTable();

            ds = objEmailBL.GetEmailData("119");

            if (ds != null)

            {

                radNTGrid.DataSource = ds;

            }

        }





        protected void NTierGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

        {



            BindData();

            

        }



        protected void NTierGrid_ItemCreated(object sender, GridItemEventArgs e)

        {



        }



        protected void NTierGrid_ItemDataBound(object sender, GridItemEventArgs e)

        {



        }



        protected void NTierGrid_ItemCommand(object source, GridCommandEventArgs e)

        {



        }



        protected void btnDelete_Click(object sender, ImageClickEventArgs e)

        {



        }



        protected void btnEdit_Click(object sender, ImageClickEventArgs e)

        {

            ImageButton editButton = (ImageButton)sender;

            Panel selectdPanel = (Panel)editButton.Parent;

            GridDataItem dataItem = (GridDataItem)selectdPanel.NamingContainer;



            

            //string fromAddd = dataItem["ColumnEmailFrom"].Text;



            //TextBox txtemail = (TextBox)RadPanelBar.FindItemByValue("EmailPanel").FindControl("MyTextBox");

            //txtemail.Text = fromAddd;

            //txtemail.BackColor = System.Drawing.Color.Aqua;



            string fromAdd=dataItem["columnEmailFrom"].Text;

            TextBox txtFrom = (TextBox)RadPanelBar.FindItemByValue("EmailPanel").FindControl("TextBoxFromAddress");

            txtFrom.Text = fromAdd;

           

           

//

((Label)RadPanelBar.FindItemByValue("EmailPanel").FindControl("LblEmailId")).Text

= dataItem["columnEmailId"].Text;

            //Label txtemail = (Label)RadPanelBar.FindItemByValue("EmailPanel").FindControl("LblEmailId");

            //txtemail.Text = emailid;

           



//((RadTextBox)RadPanelBar.FindItemByValue("EmailPanel").FindControl("radTextBoxFromAddress")).Text

= dataItem["columnEmailId"].Text;

        }





        protected void EditButton_Click(object sender, ImageClickEventArgs e)

        {



        }



        protected void DeleteButton_Click(object sender, ImageClickEventArgs e)

        {



        }



        protected void NTierGrid_PageIndexChanged(object source, GridPageChangedEventArgs e)

        {

            BindData();

            

        }



        protected void NTierGrid_PageSizeChanged(object source, GridPageSizeChangedEventArgs e)

        {

            BindData();

            

        }



        protected void btnSave_Click(object sender, ImageClickEventArgs e)

        {



        }



        protected void btnCancel_Click(object sender, ImageClickEventArgs e)

        {



        }

    }

}







<<<<<-----------------------------------------------------Web.Config-------------------------------------------------------->>>>>



<?xml version="1.0"?>

<!--

  For more information on how to configure your ASP.NET application, please visit

  http://go.microsoft.com/fwlink/?LinkId=169433

  -->

<configuration>

  <appSettings>

   

<add key="connectionstring"

value="Server=192.168.1.61;port=10080;database=xtlytics_db_frontend_dev_v8_5;user

id=pa_dev;password=12!@#$34;pooling=true;Charset=utf8"/>

  </appSettings>

  <connectionStrings/>

  <!--

    For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367.



    The following attributes can be set on the <httpRuntime> tag.

      <system.Web>

        <httpRuntime targetFramework="4.5" />

      </system.Web>

  -->

  <system.web>

    <compilation debug="true" targetFramework="4.5.1"/>

    <httpHandlers>

      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>

    </httpHandlers>

    <pages controlRenderingCompatibilityVersion="4.0"/>

  </system.web>

  <system.webServer>

    <validation validateIntegratedModeConfiguration="false"/>

    <handlers>

     

<add name="Telerik_Web_UI_WebResource_axd" verb="*"

preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd"

type="Telerik.Web.UI.WebResource"/>

    </handlers>

  </system.webServer>

</configuration>
Angel Petrov
Telerik team
 answered on 04 Mar 2015
4 answers
177 views
Hi, I have a problematic situation with a grid bounded to a datasource at runtime.
If I work on the grid only with command buttons by editing then it works by reloading the data with the DataBind method.
If I try to order or change page a javascript exception is thrown:

Exception at row 1, column 123034 in http://localhost:55112/bundles/MsAjaxJs?v=c42ygB2U07n37m_Sfa8ZbLGVu4Rr2gsBo7MvUEnJeZ81
0x800a139e - Javascript run-time error: Sys.WebForms.PageRequestManagerServerErrorException: Index is outside the range. Non-negative value and requires less the size of the collection.

See the attach files for details (is a zip)

Thanks a lot
Konstantin Dikov
Telerik team
 answered on 04 Mar 2015
6 answers
146 views
In the help documentation for the SPRadGrid, there is a note that the grid control does not work well with document libraries. What are the limitations/problems when binding to a document library? This is a rather severe limitation, given that document libraries are a first-class feature of SharePoint.

Regards,
Larkin
Marin
Telerik team
 answered on 04 Mar 2015
1 answer
80 views
Dear friends,

I have an issue after upgrading my web forms project to the new version (2015 1 225) of THE UI for ASP.NET AJAX. And it is that the code, which works ok in older versions, does not work anymore in the new version...? The error, which is produced within executing of the bellow shown methods is: "CANNOT FIND A CELL BOUND TO COLUMN...". The code:

//formating data grid
protected void RadGrid10_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = (GridDataItem)e.Item;
        dataItem.BackColor = System.Drawing.Color.FromName(dataItem["M"].Text); ;
        dataItem.Font.Size = Convert.ToInt16(dataItem["L"].Text);
        dataItem.Font.Bold = dataItem["N"].Text == "true" ? true : false;
        dataItem.Font.Italic = true;
        dataItem.BorderStyle = BorderStyle.Solid;
        dataItem.BorderWidth = Unit.Pixel(1);
        dataItem.BorderColor = System.Drawing.Color.Black;
    }
}
//export to pdf
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
    if ((String)Session["partnerHP"] != "-9999")
    {
        foreach (GridDataItem item in RadGrid10.Items)
        {
            item.Style["background-color"] = item["M"].Text;
            item.Style["font-family"] = "Arial Unicode MS";
        }
        RadGrid10.ExportSettings.Pdf.Title = hf.Value.ToString();
        RadGrid10.ExportSettings.FileName = hf.Value;
        GridHeaderItem headerItem = RadGrid10.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
        headerItem.Visible = false;
        RadGrid10.MasterTableView.ExportToPdf();
    }
    else
    {
        RadWindowManager1.RadAlert("Za izpis v pdf morajo biti prikazane podrobnosti!", 400, 150, null, null);
    }
}



P.S. Grid is dinamicaly populated using stored procedure which just returns data rows using plain select statement. Data binding is done in "On need data source" from the grid.
And also please see attached file for details. I would appreciate any suggestions.

Regards,
Erik D.
Pavlina
Telerik team
 answered on 03 Mar 2015
5 answers
410 views
Hi,

For accessibility compliance, I need to ensure my rows have headers (just like the columns). So the first cell of each datarow is like:
<th scope="row" ...>

Currently, the grid outputs:
<td scope="row" ...>


...and I don't know which property/properties to modify to get the desired change?



Cheers in advance,
Gordopolis




Lax
Top achievements
Rank 1
 answered on 03 Mar 2015
1 answer
363 views
Hi Team,
We developed Multiple fileupload feature using RadAsyncUpload  control. Telerik dll version is 2012.1.411.35.
We provided shared location path for TargetFolder and TemporaryFolder of RadAsyncUpload  control with Authenticated Users and EveryOne. But still we are getting below error.
In my Environment, we have 4 web front end servers. So we created a shared location in seperate server and assigned to Target and Temporary Folders. If I am wrong please guide me. Could you please help me asap.

And also we have one more question what account is it using to upload a files in Temp and Target folders. I mean login user or system account or network service...etc..?

Error:
System.Exception: RadAsyncUpload does not have permission to write files in the TemporaryFolder. In Medium Trust scenarios, the TemporaryFolder should be a subfolder of the Application Path.    at Telerik.Web.UI.RadAsyncUpload.TestTemporaryFolderPermissions()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyn... 2089f4ca-c105-4340-ab32-ac3565390869

Note: In DEV environment its working fine with authenticated users. with shared location as well as normal folder path.

Thanks in Advance.
Balaji
Hristo Valyavicharski
Telerik team
 answered on 03 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?