Telerik Forums
UI for ASP.NET AJAX Forum
16 answers
249 views
Hi,

My objective is to extend the current template and add one more field to the list. I figured out that the default template cannot be modified and it's not available on your website (to copy and modify).

I tried recreating the template and adding the field but the UI representation of what I'm creating is a bit off.

<InlineInsertTemplate>
    <div>
        <div>
            <telerik:RadTextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Description") %>'
                TextMode="MultiLine" Rows="2" EmptyMessage="Description" MaxLength="240"
                Width="100%">
            </telerik:RadTextBox>
            <telerik:RadTextBox ID="DocketNo" runat="server" Width="100%" EmptyMessage="Docket Number" MaxLength="15" Text='<%# Bind("DocketNo") %>'>
            </telerik:RadTextBox>
        </div>
        <div style="padding-top:10px;">
            <asp:Button ID="btnSave"  runat="server" CommandName="Insert"
                Text="Insert" />
            <asp:Button ID="btnCancel" runat="server" CommandName="Cancel"
                Text="Cancel" />
            <asp:Button ID="btnOptions" runat="server" CommandName="More"
                Text="More" />
        </div>
    </div>
</InlineInsertTemplate>


See attached image.

Any ideas?

Thanks
Daryl
Alan
Top achievements
Rank 1
 answered on 08 Aug 2011
3 answers
101 views
I am trying to develop a framework that is extensible through user controls. In order to do this, I need to be able to use a UserControl as the target of an ajax request and I need to be able to pass an argument with it. I have done this through the implementation of IPostBackEventHandler. However when it posts back, depending on the browser, it doesn't refresh the UI(IE) or it never shows the loading panel. the "btnUpdateLabel", button always works and is there as a check. the "btnClientScript" uses JS to do the ajaxrequestwithtarget which does not show the loading panel.

below are the contents of 4 files to replicate this.

aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserControlPage.aspx.cs"
    Inherits="UserControlPage" %>
 
<%@ Register src="UserControls/PostBackeEventHandlerTest.ascx" tagname="PostBackeEventHandlerTest" tagprefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="mgrScript" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="mgrAjax" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="pnlLoading" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    <uc2:PostBackeEventHandlerTest ID="PostBackeEventHandlerTest1" runat="server" />
    </form>
</body>
</html>

aspx.cs
using System;
using System.Web.UI;
using Telerik.Web.UI;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using System.Collections;
 
public partial class UserControlPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //increase the request queue so we can have multiple requests loading.
        RadAjaxManager.GetCurrent(this.Page).RequestQueueSize = 50;
    }   
}

ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PostBackeEventHandlerTest.ascx.cs" Inherits="UserControls_PostBackeEventHandlerTest" %>
<telerik:RadAjaxLoadingPanel ID="pnlLoading" Runat="server"
    Skin="Default">
</telerik:RadAjaxLoadingPanel>
<asp:Label ID="lblButtonTarget" runat="server" Text="Updated From Button"></asp:Label>
<br />
<asp:Button ID="btnUpdateLabel" runat="server" Text="Update Time Regular" />
<br />
<br />
<asp:Button ID="btnClientScript" runat="server" Text="Update Time ClientScript" />
<br />
<br />
<asp:Label ID="lblPostbackevent" runat="server" Text="Updated From PostBack"></asp:Label>

ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class UserControls_PostBackeEventHandlerTest : System.Web.UI.UserControl,IPostBackEventHandler
{
    protected void Page_Load(object sender, EventArgs e)
    {      
        var mgr = Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page);
        mgr.AjaxSettings.AddAjaxSetting(this.btnUpdateLabel, this.lblButtonTarget, this.pnlLoading);
        mgr.AjaxSettings.AddAjaxSetting(mgr, this.lblPostbackevent, this.pnlLoading);
 
        this.btnUpdateLabel.Click += new EventHandler(btnUpdateLabel_Click);
        this.btnClientScript.OnClientClick = "var mgr = $find('" + mgr.ClientID + "');mgr.ajaxRequestWithTarget('" + this.UniqueID + "', 'I need to pass a param');";
    }
 
    void btnUpdateLabel_Click(object sender, EventArgs e)
    {
        this.lblButtonTarget.Text = DateTime.Now.ToString();
    }
 
    public void RaisePostBackEvent(string eventArgument)
    {
        this.lblPostbackevent.Text = DateTime.Now.ToString();
    }
}
Sebastian
Telerik team
 answered on 08 Aug 2011
1 answer
74 views

I am looking for a simple drag and drop solution from one radgrid that simply has a ssn and name to antoher grid that has positions that personnel can fill.  When I drag from the personnel grid to the position it automatically updates the radgrid with that person whom was droped in and fills it.  I was trying to use example on the site but they use a lot of datasource objects I cannot use, mine is straight code behind.  this is what I ahve so far but the drop is not working to the other radgrid.  I guess I am not getting the Id of the row I am draggging and I need to get the Id of where I drop it to save to the database.  Here is what I have what do i need to add or do differently.


 <table width="100%">
                    <tr>
                        <td align="center" valign="top">
                             <telerik:RadGrid ID="myGridPersonnel" runat="server" Width="100%" BorderWidth="1px" CellPadding="6" GridLines="None" BorderColor="#404040" Skin="Web20">
                                <ClientSettings AllowRowsDragDrop="true">
                                    <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
                                </ClientSettings>
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="SSN_SM" GridLines="Both" BorderWidth="1px"
                                    BorderColor="#404040" Font-Size="12" Font-Names="Veranda,arial,sans-serif" HeaderStyle-HorizontalAlign="Center">
                                    <AlternatingItemStyle BackColor="#B0C4DE" />
                                    <HeaderStyle ForeColor="White" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="Name" HeaderText="NAME" />
                                        </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </td>
                        <td align="center" valign="top">
                            <telerik:RadGrid ID="myGridPositions" runat="server" Width="100%" BorderWidth="1px" CellPadding="6" GridLines="None" BorderColor="#404040" Skin="Web20">
                                <ClientSettings AllowRowsDragDrop="true">
                                    <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
                                </ClientSettings>
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="intPositionId" GridLines="Both" BorderWidth="1px"
                                    BorderColor="#404040" Font-Size="12" Font-Names="Veranda,arial,sans-serif" HeaderStyle-HorizontalAlign="Center">
                                    <AlternatingItemStyle BackColor="#B0C4DE" />
                                    <HeaderStyle ForeColor="White" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="strPosnTitle" HeaderText="TITLE" />
                                            <telerik:GridBoundColumn DataField="strpara" HeaderText="PARA" />
                                            <telerik:GridBoundColumn DataField="strLine" HeaderText="LINE" />
                                            <telerik:GridBoundColumn DataField="intPositionNum" HeaderText="POSITION" />
                                            <telerik:GridBoundColumn DataField="strGrade" HeaderText="GRADE" />
                                            <telerik:GridBoundColumn DataField="strMos" HeaderText="MOS" />
                                            <telerik:GridBoundColumn DataField="strFullName" HeaderText="Filled By" />
                                            <telerik:GridTemplateColumn HeaderText="Delete">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="Delete" runat="server" CommandArgument='<%# bind("intPositionId") %>' CommandName="Del">Delete</asp:LinkButton>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                </table>


 Protected Sub myGridPersonnel_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles myGridSoldier.RowDrop
        If String.IsNullOrEmpty(e.HtmlElement) Then
            If e.DraggedItems(0).OwnerGridID = myGridSoldier.ClientID Then
                Dim destinationIndex As Int32 = -1

                For Each dragged As GridDataItem In e.DraggedItems
                    Dim SSN As String = DirectCast(dragged.GetDataKeyValue("strssn"), String)
                    If SSN IsNot Nothing Then
                        If destinationIndex > -1 Then
                            If e.DropPosition = GridItemDropPosition.Below Then
                                destinationIndex += 1
                            End If
                            sql = "Insert tblMobUnitPersonnel (intpositionId, strssn) Values (45, " & SSN & ")"
                            Response.Write(sql)
                            Response.End()

                            insertUpdateDelete(sql)
                        Else

                        End If
                    End If
                Next
            End If
        End If
    End Sub

Tsvetina
Telerik team
 answered on 08 Aug 2011
3 answers
118 views
I have an application, where i have used RadEditor inside a page with uses master page, i have kept a button for export to PDF, the event fires when i click the button , but nothing happens on screen  , but when i remove master page the code works like a charm.

Below is the aspx code.

<asp:Button ID="ExportToPDFButton" runat="server" Text="Export to PDF" OnClick="ExportToPDFButton_Click" />
                            <telerik:RadEditor ID="ContentEditor" runat="server" ContentFilters="DefaultFilters,PdfExportFilter"
                                Width="100%">
                                <ExportSettings OpenInNewWindow="true" />
                                 
                                <Content></Content>
                            </telerik:RadEditor >


Below is the aspx.cs code

protected void ExportToPDFButton_Click(object sender, EventArgs e)
        {
            ContentEditor.ExportToPdf();
        }

Does any one have faced the problem?

Thank You in advance!
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Aug 2011
1 answer
126 views
I've added this RadSlider on my page but it looks too big: http://demos.telerik.com/aspnet-ajax/slider/examples/default/defaultcs.aspx

I saw in the source code that <a> tags are generated for each part and their background-image property is set to an embedded image from the skin.

e.g.

<a id="RadSliderDecrease_RadSlider_NoItems" href="#" class="rslHandle rslDecrease" title="Decrease"><span>Decrease</span></a>
.RadSlider_Vista .rslHorizontal a.rslHandle {
  1. background-imageurl('/aspnet-ajax/WebResource.axd?d=YKXu0uPqzZODU8Rvlz3vm72tkkulHEpAptoZciRoZVlkUEitZoBEhzYTVh0eCOgf-fLcrTuvnjwnQ_9cFRN5uK_CqhEi4d5EpjV4QZJsc7vML6J0p5rJ5pc0vb-ym1DrvoWxCHvXbRk-MXl6bny980BwLduK0DqLMasbLoyPJ_o1&t=634460641060000000');
}

How would that be possible to resize the RadSlider images to appear e.g. 50% smaller than the default images?

I hope it had a better design and instead had an <img> tag inside the <a> tag so that I could resize them easily.

Thanks,
Bozhidar
Telerik team
 answered on 08 Aug 2011
3 answers
203 views
Hello,

I'm wonder if I can create a 3D RadChart (Pie).

Please, if it is possible explain to me how to do that

Regards,
Bader
Giuseppe
Telerik team
 answered on 08 Aug 2011
0 answers
81 views
Hi,

I am new to telerik controls
scenario
    I am using formtemplate under editformsetting to generate the fields for insert and updating the records in grid. Alongside the textbox I have customized browse button in which end user select his choice of product and when he hits on complete button of popup, the item selected from the pop up grid should be displayed in the textbox. 

I am unable to assign the value to textbox on close of the window(using AJAX update) as I am not able to get the ID of the same.
<td width="10%"
    <asp:TextBox ID="ProductID" MaxLength="7" Width="200 px" Visible='<% # (Container as  GridItem).OwnerTableView.IsItemInserted %>'  runat="server"> 
  </asp:TextBox
</td
<td width="75%"
<asp:Button ID="btnBrowse" runat="server" Text="..." OnClientClick="popUp('SelectProduct');return false;" /> 
</td>


Thanks     
Vibhor
Top achievements
Rank 1
 asked on 08 Aug 2011
1 answer
337 views
hi,
i need some help/recommendations on making the header height smaller.
it seems that when we are using static-header set to True, the header get to large.

i want the static header so can someone guide us in the right direction?.

here is some of our code:

  <div style="position: absolute; top: 220px; left: 0px; right: 0px; bottom: 0px">
                    <telerik:RadGrid ID="gridGrid" runat="server" GridLines="None" AllowPaging="True"
                        AllowCustomPaging="True" Skin="Office2007" PageSize="5" AllowMultiRowSelection="True">
                        <MasterTableView DataKeyNames="Key" AlternatingItemStyle-BorderStyle="NotSet" RowIndicatorColumn-ItemStyle-VerticalAlign="Middle"
                            RowIndicatorColumn-Groupable="True" AllowFilteringByColumn="True" AllowMultiColumnSorting="True"
                            AllowSorting="True" EnableHeaderContextFilterMenu="True" EnableHeaderContextMenu="True"
                            RowIndicatorColumn-Display="False" 


  <ClientSettings AllowKeyboardNavigation="True" >
                       
                            <Resizing AllowColumnResize="True" AllowRowResize="true" EnableRealTimeResize="True"/>
                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true"/>
                        </ClientSettings>




Shinu
Top achievements
Rank 2
 answered on 08 Aug 2011
1 answer
185 views

i am running into a problem of returning a server side popup. here's my situation

 

1. I am having a grid with a edit command column as

       <telerik:GridEditCommandColumn UniqueName="actions" EditText="Go" ButtonType="PushButton">

            </telerik:GridEditCommandColumn>

2. the editform settings are

       <EditFormSettings PopUpSettings-Modal="true" InsertCaption="Actions" EditFormType="Template">

            <FormTemplate>

                <Action:actions ID="something" runat="server" />

            </FormTemplate>

        </EditFormSettings>

 

3. on the click of of the go button the popup displays a user control

4. on the user control i am displaying a list of link buttons ( can use any of the buttons rad or asp)

5. on the click of the link on the popup i want to navigate to a url built on the code behind for each button.

prior to  navigating to the url, i have to check if the some variables are valid or not for e.g.

if(x is true)

ask user a (some custom message as: this is the situation want to continue)

if user say yes navigate to the url otherwise do nothing or close the edit form popup.

 

the message is different for each linkbutton on the page.

 

I have tried few things nothing seems to be working (frustrated)
on the onclick of the link button, in the code behind:

1. tried using the scriptmanager in code behind as and call the confirmation method by passing in the messga parameter

string messgae = "some messagae"

 ScriptManager.RegisterStartupScript(Page, Page.GetType(), "confirm", "confirmation('&message&')", true);

 

this returns object not defined errorsonce the link is clicked

2. tried

string message = "so ethnugsa";

Page.ClientScript.RegisterStartupScript(this.GetType(), "radConfirm", "radConfirm('"message"', 200,200);", true);

 

not displaying any popup???? and am not sure even if it displays how would i be restricting the user to not navigate on cancel or No click on the popup.

 

 

helppppppp

 

Shinu
Top achievements
Rank 2
 answered on 08 Aug 2011
1 answer
108 views
Hi,

I've created an onneeddatasource by double clicking the radgrid and this creates a code behind event that work nicely.

I also need to create an update and insert event in the code behind. Writing directly into the ASPX 'source' seems to fail since the events never fire in the code behind. Please tell me the way to use design mode to create an update and insert event on the code behind.

thanks,
Minh Bui

Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?