Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
799 views
I may be wrong but it seems to me that the only way to populate a drop down column in a grid is with databinding. Is there a way to poopulate the items as follows:

combobox.items.add("First Item");
combobox.items.add("Second Item");
etc.

I don't need to populate from tables for each drop down column.

Regards, Lee
Lee
Top achievements
Rank 1
 answered on 19 Jan 2011
1 answer
86 views
Hi!
I'm having a problem with the templateColumn. I can have a merged header, but for some reason, there's no way I can edit the value of the items under that column. I've been reading as many post as I could, but no answer so far.
I've tried different approaches, but the last best I could do was this:


<telerik:RadGrid ID="RadGrid1" EnableAJAX="True" ShowStatusBar="true" runat="server" Skin="Default" BorderColor="#97A222"  Width="95%"
            AutoGenerateColumns="False" PageSize="16" AllowSorting="True" AllowMultiRowSelection="False"
            AllowAutomaticDeletes="True" AllowAutomaticUpdates="True"
            AllowPaging="False" AllowScroll = "True" GridLines="None" OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource">
             
            <MasterTableView Width="100%" DataKeyNames="Name" AllowMultiColumnSorting="True">
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="Name" DataMember="Details" Width="100%" GridLines="Horizontal"
                       AllowAutomaticDeletes="True" AllowAutomaticUpdates="True"
                        Style="border-color: #d5b96a" CssClass="RadGrid2">
                        <Columns>
                                
                               <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn" CancelText="Cancel"
                                EditText="Edit">
                              <HeaderStyle Width="85px"></HeaderStyle>
                             
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn SortExpression="Name" HeaderText="Name" ReadOnly = "True" HeaderButtonType="TextButton"
                                DataField="Name">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                              <HeaderTemplate>
                               <table id="Table1" cellspacing="1" cellpadding="1" width="300" border="1">
                                <tr>
                                 <td colspan="2" align="center"><b>Revenue Growth Strategy</b></TD>
                                </tr>
                                <tr>
                                 <td width="50%"><b>Drive organic growth</b></TD>
                                 <td width="50%"><b>Global expansion</b></TD>
                                </TR>
                               </TABLE>
                              </HeaderTemplate>
                              <ItemTemplate>
                               <table id="Table2" cellspacing="1" cellpadding="1" width="300" border="1">
                                <tr>
                                 <td width="50%"><%# DataBinder.Eval(Container.DataItem , "Drive organic growth")%></TD>
                                 <td width="50%"><%# DataBinder.Eval(Container.DataItem, "Global expansion")%></TD>
                                </tr>
                               </table>
                              </ItemTemplate>
                           </telerik:GridTemplateColumn>
                             
                            <telerik:GridBoundColumn SortExpression="Drive organic growth" HeaderText="Drive organic growth" HeaderButtonType="TextButton"
                                DataField="Drive organic growth">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Global expansion" HeaderText="Global expansion" HeaderButtonType="TextButton"
                                DataField="Global expansion">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Market new products and services" HeaderText="Market new products and services" HeaderButtonType="TextButton"
                                DataField="Market new products and services">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Operational improvement" HeaderText="Operational improvement" HeaderButtonType="TextButton"
                                DataField="Operational improvement">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Technology initiatives" HeaderText="Technology initiatives" HeaderButtonType="TextButton"
                                DataField="Technology initiatives">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Customer convenience" HeaderText="Customer convenience" HeaderButtonType="TextButton"
                                DataField="Customer convenience">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="Name" HeaderText="Name" HeaderButtonType="TextButton"
                        DataField="Name">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>


I'll appreciate any help.
Daniel
Top achievements
Rank 1
 answered on 19 Jan 2011
20 answers
579 views

When creating an custom DataFieldEditor an error is thrown upon postback.
The custom class looks like (same implementation as the RadFilterTextFieldEditor)

Public Class RadFilterMyTextFieldEditor  
    Inherits RadFilterDataFieldEditor  
 
    Protected Overrides Sub CopySettings(ByVal baseEditor As RadFilterDataFieldEditor)  
        MyBase.CopySettings(baseEditor)  
        Dim editor As RadFilterTextFieldEditor = TryCast(baseEditor, RadFilterTextFieldEditor)  
        If (Not editor Is Nothing) Then  
            Me.TextBoxWidth = editor.TextBoxWidth  
        End If  
    End Sub  
 
    Public Overrides Function ExtractValues() As ArrayList  
        Dim list As New ArrayList  
        list.Add(Me._textBoxControl.Text)  
        If Not MyBase.IsSingleValue Then  
            list.Add(Me._secondTextBoxControl.Text)  
        End If  
        Return list  
    End Function  
 
    Public Overrides Sub InitializeEditor(ByVal container As Control)  
        Me._textBoxControl = New TextBox  
        Me._textBoxControl.CssClass = "rfText" 
        Me._textBoxControl.Width = Unit.Pixel(Me.TextBoxWidth)  
        container.Controls.Add(Me._textBoxControl)  
        If Not MyBase.IsSingleValue Then  
            MyBase.AddBetweenDelimeterControl(container)  
            Me._secondTextBoxControl = New TextBox  
            Me._secondTextBoxControl.CssClass = ("rfText")  
            Me._secondTextBoxControl.Width = Unit.Pixel(Me.TextBoxWidth)  
            container.Controls.Add(Me._secondTextBoxControl)  
        End If  
    End Sub  
 
    Public Overrides Sub SetEditorValues(ByVal values As ArrayList)  
        If (Not values Is Nothing) Then  
            If (Not values.Item(0) Is Nothing) Then  
                Me._textBoxControl.Text = (values.Item(0).ToString)  
            End If  
            If (Not MyBase.IsSingleValue AndAlso (Not values.Item(1) Is Nothing)) Then  
                Me._secondTextBoxControl.Text = values.Item(1).ToString  
            End If  
        End If  
    End Sub  
 
    <DefaultValue("120"), NotifyParentProperty(True)> _  
    Public Property TextBoxWidth() As Integer  
        Get  
            Dim obj2 As Object = MyBase.ViewState.Item("TextBoxWidth")  
            If (obj2 Is Nothing) Then  
                Return 120  
            End If  
            Return CInt(obj2)  
        End Get  
        Set(ByVal value As Integer)  
            MyBase.ViewState.Item("TextBoxWidth") = value  
        End Set  
    End Property  
 
    ' Fields  
    Private _secondTextBoxControl As TextBox  
    Private _textBoxControl As TextBox  
 
End Class 

When using this on a web form like

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init  
 
        Dim oMyTextFilter As New RadFilterMyTextFieldEditor  
        oMyTextFilter.FieldName = "Company" 
 
        RadFilter1.FieldEditors.Add(oMyTextFilter)  
 
    End Sub  
 

The following error is thrown upon postback

Exception Details: System.ArgumentNullException: Value cannot be null.  
Parameter name: item  
 
Source Error:   
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.    
 
Stack Trace:   
 
 
[ArgumentNullException: Value cannot be null.  
Parameter name: item]  
   Telerik.Web.UI.RadFilterDataFieldEditorCollection.InsertInternal(Int32 index, RadFilterDataFieldEditor item) +77  
   Telerik.Web.UI.RadFilterDataFieldEditorCollection.Add(RadFilterDataFieldEditor item) +40  
   Telerik.Web.UI.RadFilterDataFieldEditorCollection.System.Web.UI.IStateManager.LoadViewState(Object state) +602  
   Telerik.Web.UI.RadFilter.LoadViewState(Object savedState) +155  
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +183  
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134  
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221  
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134  
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221  
   System.Web.UI.Page.LoadAllState() +312  
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1661  
 
   
 

What goes wrong?
My intention is to create a custom editor with dropdown list boxes in stead of the regular text edits


Steve McManamam
Top achievements
Rank 1
 answered on 19 Jan 2011
9 answers
519 views
Code in aspx:

<asp:UpdatePanel ID="upComboBox" runat="server">  
                <ContentTemplate> 
                    <telerik:RadComboBox ID="rcb" runat="server" SkinID="Larger" Height="200px">  
                        <ItemTemplate> 
                            <telerik:RadTreeView ID="rtv" runat="server" OnNodeClick="rtv_NodeClick" 
                                CausesValidation="false">  
                            </telerik:RadTreeView> 
                        </ItemTemplate> 
                        <Items> 
                            <telerik:RadComboBoxItem Selected="true" /> 
                        </Items> 
                    </telerik:RadComboBox> 
                </ContentTemplate> 
</asp:UpdatePanel> 


  Code in aspx.cs

 protected void rtv_NodeClick(object sender, RadTreeNodeEventArgs e)  
 {  
     rcb.Items[0].Value = e.Node.Value;  
     rcb.Items[0].Text = e.Node.Text;  
 }  

This method won't stop whole page postback when you trigger the rtv_NodeClick event

There somebody said, should put the updatepanel inside ComboBox like follows
  <telerik:RadComboBox ID="rcbConsigned" runat="server" SkinID="Larger" Height="200px">  
                        <ItemTemplate> 
                            <asp:UpdatePanel ID="up" runat="server">  
                                <ContentTemplate> 
                                    <telerik:RadTreeView ID="rtvSubcon" runat="server" OnNodeClick="rtvSubcon_NodeClick" 
                                        CausesValidation="false">  
                                    </telerik:RadTreeView> 
                                </ContentTemplate> 
                            </asp:UpdatePanel> 
                        </ItemTemplate> 
                        <Items> 
                            <telerik:RadComboBoxItem Selected="true" /> 
                        </Items> 
                    </telerik:RadComboBox> 
This method can stop the whole page postback, but as ajax method, it won't change the value of radcombox.

As we were told ms-help://telerik.aspnetajax.radcontrols.2009.Q1/telerik.aspnetajax.radajax.2009.Q1/3rdparty.html

Controls that Are Not Compatible with RadAjaxManager Control

The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported as initiating or updated controls:



 
Simon
Telerik team
 answered on 19 Jan 2011
1 answer
102 views
Do you have good example of RadUpload controls inside Formview Control with server side API?
When i upload file , i can find the control but when i save i could not find posted file.

Thanks,
Dimitar Terziev
Telerik team
 answered on 19 Jan 2011
1 answer
169 views
The question is twofold:
Question 1. How, when I have an update in BmpDemographic1 can I get the ajax to fire on BmpSelectList? Right now when I update BmpDemographic1, the ajax files on the updatedcontrol and BmpSelectList also updates as it is being told to. However the loadingpanel does not fire. I am assuming the following.. on the aspx RadajaxManager, declare the user controls and their related updatedcontrols... ie UC1 manages UC2 and UC3. When UC2 is updated, Update UC1.

aspx page code:

 

<uc2:BmpSelectList ID="BmpSelectList1" runat="server" />
  <table><tr><td
  <uc3:BmpDemographic  ID="BmpDemographic1" runat="server" />    
</td><td rowspan="3">
    <uc1:BmpRcds ID="BmpRcds1" runat="server" />
    </td>
</tr> </table>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1"  Runat="server" 
        Skin="Default" >
    </telerik:RadAjaxLoadingPanel>
          
<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" runat="server">
   <AjaxSettings>
     <telerik:AjaxSetting AjaxControlID="BmpSelectList1">
         <UpdatedControls>
         <telerik:AjaxUpdatedControl ControlID="BmpDemographic1"  />
         <telerik:AjaxUpdatedControl ControlID="BmpRcds1"  />
         </UpdatedControls>
         </telerik:AjaxSetting>
       <telerik:AjaxSetting AjaxControlID="BmpDemographic1">
         <UpdatedControls>
         <telerik:AjaxUpdatedControl ControlID="BmpSelectList1" LoadingPanelID="RajAjaxLoadingPanel1" />
         </UpdatedControls>
         </telerik:AjaxSetting>
         <telerik:AjaxSetting AjaxControlID="BmpRcds1">
         <UpdatedControls>
         <telerik:AjaxUpdatedControl ControlID="BmpSelectList1" />
         </UpdatedControls>
         </telerik:AjaxSetting>
         </AjaxSettings>
      </telerik:RadAjaxManager>


Within my ascx files I have the following:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function myUserControlClickHandler() {
                $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("content");
            }
        </script>
    </telerik:RadCodeBlock>    
       
   <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1"  runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="AsocDD">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="status" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="AdvisorDD">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="status" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
  
 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" 
          Skin="Default" >
      </telerik:RadAjaxLoadingPanel>

Within my code I essentially say when the dropdown is updated, throw and update request back to the other uc. This gets handled in the  page_Prerender event on the .aspx.vb page
If IsNumeric(BmpDemographic1.Update) = True Then
BmpSelectList1.SendID = BmpDemographic1.Update ' Keep the selected row
BmpSelectList1.updategrid() ' Radgrid.mastertable.rebind()
BmpDemographic1.Update = Nothing ' clear the update property
End If

Any Idea why  I can't get the loading panel on BmpSelectList1 to show?

-------------------------------------------




Maria Ilieva
Telerik team
 answered on 19 Jan 2011
7 answers
267 views
I have a window that a user can open multiple times while on a page and is defined in a RadWindowManager and opened client side uses the below code.  I need the window maximized every time it is opened so I call the maximize function since the InitialBehaviors is only used the first time the windows is opened.  The window is defined in the RadWindowManager as a modal window and when the maximize function is called the window gets maximized, but is moved behind it's own gray background making it unusable.  If I set the ShowOnTopWhenMazimized to false it maximizes the window without moving it back, but this doesn't seem logical.  Is there a better way to do this or is there a fix.

function openWindow(link, radWindowID, maximize){
    var oManager = $find("<%= RadWindowManager.ClientID %>");
    var oWin = oManager.open(link, radWindowID);
    if(maximize) oWin.maximize();
    return false;
}
Svetlina Anati
Telerik team
 answered on 19 Jan 2011
1 answer
318 views
Hello,

I'm trying to populate a RadGrid with data from a WebMethod call, and I'm having no luck.  The primary example I'm trying to use (Here) doesn't tell me what type of data to return in the GetData method, and doesn't show example code for the Web Service.  Below is my example code, what is wrong with it?

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" TagPrefix="tel" Namespace="Telerik.Web.UI" %>
 
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent" >
    <asp:Label ID="Label1" runat="server" Text="" />
    <tel:RadScriptManager runat="server"></tel:RadScriptManager>
    <tel:RadGrid ID="RadGrid1" runat="server">
        <MasterTableView>
            <Columns>
                <tel:GridBoundColumn DataField="ID" HeaderText="ID" DataType="System.Int32" />
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <DataBinding Location="Services/WerbService.asmx" SelectMethod="HelloWorld2" />
        </ClientSettings>
    </tel:RadGrid>
</asp:Content>

WerbService.asmx Codebehind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Telerik.Web.UI;
 
/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "WerbServices")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WerbService : System.Web.Services.WebService {
 
    public WerbService () {
 
        //Uncomment the following line if using designed components
        //InitializeComponent();
    }
 
    [WebMethod]
    public static object HelloWorld2(int startRowIndex, int maximumRows, List<GridSortExpression> sortExpression, List<GridFilterExpression> filterExpression)
    {
        return new[] {
            new{ID = "Hello World"}
        };
    }
     
}

Marin
Telerik team
 answered on 19 Jan 2011
3 answers
166 views
Hi. In many parts of my application when an item gets deleted I show a radalert to confirm to the user if the item has been deleted successfully or not. This has worked for me well until I needed to attach a radconfirm before the radalert. The js error that appears is "object doesn't support this property or method". This is all happening from a radtoolbar so I've followed the article here to get the radconfirm working. A regular js alert works okay.

This code has worked for me in the past.

if (rows >= 1)
{
    script = @"var oWnd = radalert('The item was deleted successfully. Click OK to redirect to the Q&A home page.', 330, 210); var browserWin = oWnd.BrowserWindow; var fn = new browserWin.Function('oWnd', 'window.location.href = ""/teams/hr/qa/""'); oWnd.add_close(fn);";
    //script = @"alert('The item was deleted successfully. Click OK to redirect to the Q&A home page.'); window.location.href = '/teams/hr/qa/';";
}
else
{
    script = @"var oWnd = radalert('An error occurred deleting the item. Please contact the ServiceDesk on x4555. Click OK to redirect to the Q&A home page.', 330, 210); var browserWin = oWnd.BrowserWindow; var fn = new browserWin.Function('oWnd', 'window.location.href = ""/teams/hr/qa/""'); oWnd.add_close(fn);";
    //script = @"alert('An error occurred deleting the item. Please contact the ServiceDesk on x4555. Click OK to redirect to the Q&A home page.');";
}
myAjaxManager.ResponseScripts.Add(script);

Thanks

Daniel
Svetlina Anati
Telerik team
 answered on 19 Jan 2011
1 answer
171 views

Hi,

I am new to Telerik controls and i'm trying to use a radAjaxLoadingPanel to show activity when using a RadGrid. I have managed to get the radAjaxLoadingPanel to show it's default image but it does not seem to animate it to show the circle spinning, instead just shows a static image. My code for the page is below. Am i missing something here? 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TotalTargets.aspx.cs" Inherits="WorkStreamList"
StylesheetTheme="SkinFile" %>
  
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title>Totals for Annual Targets</title>
    <link href="General.css" rel="stylesheet" type="text/css" />
    <!-- custom head section -->
    <style type="text/css">
        .MyImageButton
        {
           cursor: hand;
        }
        .EditFormHeader td
        {
            font-size: 14px;
            padding: 4px !important;
            color: #0066cc;
        }
        </style>
    <!-- end of custom head section -->
  
</head>
<body>
    <form id="form1" runat="server">
  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
               
  
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All"  Skin="Web20"  EnableAjaxSkinRendering="true" EnableRoundedCorners="true"
           EnableEmbeddedSkins="true" EnableEmbeddedScripts="true" EnableEmbeddedBaseStylesheet="true" EnableTheming="true" EnableViewState="true" />
  
        <table border="0" cellpadding="0" cellspacing="0" style="height:30px; width:100%;" >
        <tr><td  style="width:80%">
            <img id="Img1" alt="Savings Plans" src="Pics/SavingsPlansTitle2.gif" runat="server"  />
              <asp:Label ID="lblUserName" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="Black"
                Style="font-size: Small"></asp:Label
        </td><td style="width:20%" align="right">
        <asp:UpdateProgress runat="server" ID="updateprogress1" >
            <ProgressTemplate >
            <div class="progress">
                <img alt="" src="Pics/load.gif"  
                    style="width: 30px; height: 30px; vertical-align:middle" /><b><span style="font-size: small; color: #FF0000">
                Please Wait...</span></b>
            </div
            </ProgressTemplate>
        </asp:UpdateProgress>
        </td></tr>
  
        </table>
          
        <div id="MainSection" runat="server" >
  
        <div style="width: 800px; text-align: center;">
            <asp:UpdatePanel ID="UpdatePanel3" runat="server"  >
                <ContentTemplate>
                    <asp:Label ID="lblError" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="Red"
                        Style="font-size: small"></asp:Label>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
          
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SavingsPlanDBConnectionString %>"
                SelectCommand="SELECT [id], [BusinessCode], [BusinessUnit], [Directorate], [TotalTarget], [FinancialYear] FROM [OverallTargets]" 
                DeleteCommand="DELETE FROM [OverallTargets] WHERE [id] = @id" 
                InsertCommand="INSERT INTO [OverallTargets] ([BusinessCode], [BusinessUnit], [Directorate], [TotalTarget], [FinancialYear]) VALUES (@BusinessCode, @BusinessUnit, @Directorate, @TotalTarget, @FinancialYear)" 
                UpdateCommand="UPDATE [OverallTargets] SET [BusinessCode] = @BusinessCode, [BusinessUnit] = @BusinessUnit, [Directorate] = @Directorate, [TotalTarget] = @TotalTarget, [FinancialYear] = @FinancialYear WHERE [id] = @id" >
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="BusinessCode" Type="String" />
                <asp:Parameter Name="BusinessUnit" Type="String" />
                <asp:Parameter Name="Directorate" Type="String" />
                <asp:Parameter Name="FinancialYear" Type="String" />
                <asp:Parameter Name="TotalTarget" Type="Decimal" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="BusinessCode" Type="String" />
                <asp:Parameter Name="BusinessUnit" Type="String" />
                <asp:Parameter Name="Directorate" Type="String" />
                <asp:Parameter Name="FinancialYear" Type="String" />
                <asp:Parameter Name="TotalTarget" Type="Decimal" />
            </InsertParameters>
        </asp:SqlDataSource>
          
        <asp:SqlDataSource ID="DS_Directorate" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DataAcademy400ConnectionString %>" 
            SelectCommand="SELECT DISTINCT LOWER(DirectorateDescription) AS DirectorateDescription FROM ORACLE_DS_GL_Hierarchy WHERE (DirectorateCode <> 'BS') ORDER BY DirectorateDescription" >
        </asp:SqlDataSource>
          
        <br />
        <asp:Label ID="Label2" runat="server" Text="Total Targets:" ForeColor="Black" Font-Size="Medium"  Font-Bold="True" Font-Names="Monotype Corsiva,Verdana"></asp:Label>
        <br />
          
  
  
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
            </script>
  
        </telerik:RadCodeBlock>
  
  
  
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
  
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" HorizontalAlign="Center" Visible="true" Skin="Web20" 
            RegisterWithScriptManager="true"/>
          
  
        <telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" PageSize="10" AllowAutomaticUpdates="True" AllowPaging="True"
            AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Skin="Web20" >
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="Id"
                DataSourceID="SqlDataSource1" HorizontalAlign="NotSet" AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <ItemStyle CssClass="MyImageButton" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="Id" HeaderText="Id" SortExpression="Id"
                        UniqueName="Id" ColumnEditorID="GridTextBoxColumnEditor1">
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn DataField="BusinessCode" DataSourceID="SqlDataSource1"
                        HeaderText="BusinessCode" ListTextField="BusinessCode" ListValueField="BusinessCode"
                        UniqueName="BusinessCode" ColumnEditorID="GridDropDownColumnEditor1">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn DataField="BusinessUnit" DataSourceID="SqlDataSource1"
                        HeaderText="BusinessUnit" ListTextField="BusinessUnit" ListValueField="BusinessUnit"
                        UniqueName="BusinessUnit" ColumnEditorID="GridDropDownColumnEditor2">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn DataField="Directorate" HeaderText="Directorate"
                        SortExpression="Directorate" UniqueName="Directorate" Visible="True"
                        EditFormColumnIndex="1" ColumnEditorID="GridTextBoxColumnEditor2">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FinancialYear" HeaderText="FinancialYear"
                        SortExpression="FinancialYear" UniqueName="FinancialYear" Visible="True"
                        EditFormColumnIndex="1" ColumnEditorID="GridTextBoxColumnEditor3">
                    </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="TotalTarget" SortExpression="TotalTarget" UniqueName="TemplateColumn"
                                                EditFormColumnIndex="1">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="lblTotalTarget" Text='<%# Eval("TotalTarget", "{0:C}") %>'></asp:Label>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <span><telerik:RadNumericTextBox runat="server" ID="tbTotalTarget" Width="40px" DbValue='<%# Bind("TotalTarget") %>'></telerik:RadNumericTextBox><span
                        style="color: Red"><asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="tbTotalTarget"
                        ErrorMessage="*" runat="server">
                                </asp:RequiredFieldValidator></span>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
  
                    <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                        UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings ColumnNumber="2" CaptionDataField="Id" CaptionFormatString="Edit properties of Product {0}" InsertCaption="New Product">
                   <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                    <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                        Width="100%" />
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                        UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" />
            </ClientSettings>
  
        </telerik:RadGrid>
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="200px" />
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor2" runat="server" TextBoxStyle-Width="150px" />
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor3" runat="server" TextBoxStyle-Width="150px" />
        <telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server" DropDownStyle-Width="110px" />
        <telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor2" runat="server" DropDownStyle-Width="110px" />
        <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server" NumericTextBox-Width="40px" />
          
  
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SavingsPlanDBConnectionString %>" 
            SelectCommand="SELECT [id], [BusinessCode], [BusinessUnit], [Directorate], [TotalTarget], [SortOrder] FROM [OverallTargets]"
            FilterExpression="id='{0}'" 
                DeleteCommand="DELETE FROM [OverallTargets] WHERE [id] = @id" 
                InsertCommand="INSERT INTO [OverallTargets] ([BusinessCode], [BusinessUnit], [Directorate], [TotalTarget], [SortOrder]) VALUES (@BusinessCode, @BusinessUnit, @Directorate, @TotalTarget, @SortOrder)" 
                UpdateCommand="UPDATE [OverallTargets] SET [BusinessCode] = @BusinessCode, [BusinessUnit] = @BusinessUnit, [Directorate] = @Directorate, [TotalTarget] = @TotalTarget, [SortOrder] = @SortOrder WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
  
            <UpdateParameters>
                <asp:Parameter Name="BusinessCode" Type="String" />
                <asp:Parameter Name="BusinessUnit" Type="String" />
                <asp:Parameter Name="Directorate" Type="String" />
                <asp:Parameter Name="TotalTarget" Type="Decimal" />
                <asp:Parameter Name="SortOrder" Type="Int32" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="BusinessCode" Type="String" />
                <asp:Parameter Name="BusinessUnit" Type="String" />
                <asp:Parameter Name="Directorate" Type="String" />
                <asp:Parameter Name="TotalTarget" Type="Decimal" />
                <asp:Parameter Name="SortOrder" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
                  
        <br /><br /> 
          
        <asp:LinkButton ID="btnHome" OnClick="btnHome_Click" 
        runat="server" CausesValidation="False" 
        Text="<img style='v-align:bottom; margin-top:3px;Border-style:none;' src='Pics/home2.gif' alt='Back To Home Page'>"></asp:LinkButton>
         Back To Home Page
          
        <br /><br />
        <asp:LinkButton ID="btnBack" OnClick="btnBack_Click" 
        runat="server" CausesValidation="False" 
        Text="<img style='v-align:bottom; margin-top:3px;Border-style:none;' src='Pics/back.png' alt='Back To Home Page'>"></asp:LinkButton>
         Back To Reference Tables Page        
          
    </div
    </form>
</body>
</html>

 

Tsvetina
Telerik team
 answered on 19 Jan 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?