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

I am trying to :
a. create a header text for my OrderId column in my nested grid and the specific Employee, something like: "Orders for <Last Name> "
b. when i press the Go button I would like to display the EmployeeID?

thanks

D

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="NestedNew.aspx.vb" Inherits="NestedNew" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head id="Head1" runat="server"
</head> 
<body class="BODY"
    <form runat="server" id="mainForm" method="post"
    <telerik:RadScriptManager runat="server" ID="ScriptManager1"
    </telerik:RadScriptManager> 
    <!-- content start --> 
    <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" /> 
    <telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" DataSourceID="SqlDataSource1" 
        runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False" 
        AllowPaging="True" PageSize="5" GridLines="None" ShowGroupPanel="true"
        <PagerStyle Mode="NumericPages"></PagerStyle> 
        <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="EmployeeID" AllowMultiColumnSorting="True" 
            GroupLoadMode="Server"
            <NestedViewTemplate> 
                <asp:Label ID="label1" runat="server" Text='<%# Eval ("EmployeeID") %>'></asp:Label> 
                <asp:Label ID="label2" runat="server" Text='<%# Eval ("LastName") %>'></asp:Label> 
                <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false"
                    <telerik:RadGrid runat="server" ID="OrdersGrid" DataSourceID="ObjectDataSource1" OnItemDataBound="onitemdatabound" 
                        OnItemCommand="onitemnested_command" ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false"
                        <MasterTableView ShowHeader="true" AutoGenerateColumns="true" AllowPaging="true" 
                            DataKeyNames="OrderID" PageSize="7" HierarchyLoadMode="ServerOnDemand"
                            <Columns> 
                                <telerik:GridEditCommandColumn> 
                                </telerik:GridEditCommandColumn> 
                            </Columns> 
                            <EditFormSettings EditFormType="Template"
                                <FormTemplate> 
                                    <asp:Button ID="btninsert" runat="server" CommandName="PerformInsert" Text="go" /> 
                                </FormTemplate> 
                            </EditFormSettings> 
                        </MasterTableView> 
                    </telerik:RadGrid> 
                           <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetEmployeeid" 
                    TypeName="EmployeesODS"
                    <SelectParameters> 
                        <asp:ControlParameter ControlID="Label1" Name="empid" PropertyName="Text" 
                            Type="String" /> 
                    </SelectParameters> 
                </asp:ObjectDataSource> 
                    <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
                        ProviderName="System.Data.SqlClient" SelectCommand="SELECT OrderID, [Order Details].UnitPrice, Quantity, Discount, Products.ProductName FROM ([Order Details] LEFT JOIN Products on [Order Details].ProductID = Products.ProductID) where OrderID = @OrderID" 
                        runat="server"
                        <SelectParameters> 
                            <asp:SessionParameter Name="OrderID" SessionField="OrderID" Type="Int32" /> 
                        </SelectParameters> 
                    </asp:SqlDataSource> 
                </asp:Panel> 
          
            </NestedViewTemplate> 
            <Columns> 
                <telerik:GridBoundColumn SortExpression="FirstName" HeaderText="First Name" HeaderButtonType="TextButton" 
                    DataField="FirstName" UniqueName="FirstName"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="LastName" HeaderText="Last Name" HeaderButtonType="TextButton" 
                    DataField="LastName" UniqueName="LastName"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="Title" HeaderText="Title" HeaderButtonType="TextButton" 
                    DataField="Title" UniqueName="Title"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="BirthDate" DataFormatString="{0:MM/dd/yyyy}" 
                    HeaderText="Birth Date" HeaderButtonType="TextButton" DataField="BirthDate" UniqueName="BirthDate"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="City" HeaderText="City" HeaderButtonType="TextButton" 
                    DataField="City" UniqueName="City"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn SortExpression="Country" HeaderText="Country" HeaderButtonType="TextButton" 
                    DataField="Country" UniqueName="Country"
                </telerik:GridBoundColumn> 
            </Columns> 
        </MasterTableView> 
        <ClientSettings AllowDragToGroup="true" /> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Employees" 
        runat="server"></asp:SqlDataSource> 
    <!-- content end --> 
    </form> 
</body> 
</html> 
 

Imports Telerik.Web.UI 
Imports System 
Imports System.Data 
Imports System.Data.SqlClient 
Imports System.Web.UI.WebControls 
Imports System.Configuration 
 
Partial Class NestedNew 
    Inherits System.Web.UI.Page 
 
    Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles RadGrid1.PreRender 
        If Not Page.IsPostBack Then 
            RadGrid1.MasterTableView.Items(0).Expanded = True 
            RadGrid1.MasterTableView.Items(0).ChildItem.FindControl("InnerContainer").Visible = True 
        End If 
    End Sub 
 
    Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand 
        If e.CommandName = RadGrid.ExpandCollapseCommandName Then 
 
            Session("EmployeeName") = DirectCast(source, Telerik.Web.UI.RadGrid).MasterTableView.Items(e.Item.ItemIndex)("LastName").Text 
            DirectCast(e.Item, GridDataItem).ChildItem.FindControl("InnerContainer").Visible = Not e.Item.Expanded 
        End If 
 
 
    End Sub 
 
    Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid1.ItemCreated 
        If TypeOf e.Item Is GridNestedViewItem Then 
            e.Item.FindControl("InnerContainer").Visible = (DirectCast(e.Item, GridNestedViewItem)).ParentItem.Expanded 
        End If 
    End Sub 
 
 
    Public Shared Function GetDataTable(ByVal query As String) As DataTable 
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString 
        Dim conn As SqlConnection = New SqlConnection(ConnString) 
        Dim adapter As SqlDataAdapter = New SqlDataAdapter 
        adapter.SelectCommand = New SqlCommand(query, conn) 
        Dim table1 As New DataTable 
        conn.Open() 
        Try 
            adapter.Fill(table1) 
        Finally 
            conn.Close() 
        End Try 
        Return table1 
    End Function 
 
  
 
    Protected Sub onitemnested_command(ByVal source As Object, ByVal e As GridCommandEventArgs) 
        If e.CommandName = RadGrid1.PerformInsertCommandName Then 
            'write the employeeid 
            'Response.Write(label1.text) 
        End If 
    End Sub 
 
    Protected Sub onitemdatabound(ByVal sender As Object, ByVal e As GridItemEventArgs) 
        If e.Item.ItemType = GridItemType.Header And Not Session("EmployeeName") Is Nothing Then 
            Dim hd As GridHeaderItem = e.Item 
            hd("OrderID").Text = " the orders for " + Session("EmployeeName").ToString() 
 
 
        End If 
    End Sub 
End Class 
 


App_Code folder :

Imports Microsoft.VisualBasic 
 
Imports Telerik.Web.UI 
Imports System 
Imports System.Data 
Imports System.Data.SqlClient 
Imports System.Web.UI.WebControls 
Imports System.Configuration 
 
Public Class EmployeesODS 
    Public Shared Function GetEmployeeid(ByVal empid As StringAs ArrayList 
 
        Dim arr As New ArrayList 
 
 
        For Each dr As DataRow In GetDataTable("Select * from orders where employeeid='" + empid + "'").Rows 
 
            Dim emp As New Employee 
            emp.EmployeeID = dr("EmployeeID"
            emp.OrderId = dr("OrderID"
            arr.Add(emp) 
        Next 
 
        Return arr 
    End Function 
 
    Public Shared Function GetDataTable(ByVal query As StringAs DataTable 
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString 
        Dim conn As SqlConnection = New SqlConnection(ConnString) 
        Dim adapter As SqlDataAdapter = New SqlDataAdapter 
        adapter.SelectCommand = New SqlCommand(query, conn) 
        Dim table1 As New DataTable 
        conn.Open() 
        Try 
            adapter.Fill(table1) 
        Finally 
            conn.Close() 
        End Try 
        Return table1 
    End Function 
End Class 
 
 
Public Class Employee 
    Private _OrderId As String 
    Private _CompanyName As String 
    Private _EmployeeID As String 
 
 
 
    Public Property CompanyName() As String 
        Get 
            Return _CompanyName 
        End Get 
        Set(ByVal value As String
            _CompanyName = value 
        End Set 
    End Property 
 
    Public Property EmployeeID() As String 
        Get 
            Return _EmployeeID 
        End Get 
        Set(ByVal value As String
            _EmployeeID = value 
        End Set 
    End Property 
 
    Public Property OrderId() As String 
        Get 
            Return _OrderId 
        End Get 
        Set(ByVal value As String
            _OrderId = value 
        End Set 
    End Property 
 
 
End Class 
 

Rosen
Telerik team
 answered on 28 Jan 2010
1 answer
112 views
Hello,
I'd used bar chart, line chart and bezier chart to show the same data, both of bar chart and line chart were going well, however, when selecting bezier chart, I got the error message shown in the clip, is there any ways to capture error and do some external work to prevent this yellow page?

Regards,

Ves
Telerik team
 answered on 28 Jan 2010
1 answer
205 views
Hello,

I try to use a hierarchical grid using entity-data. Viewing, updating both entities works fine but inserting doesn´t work. I get "Object reference not set to an instance of an object." in " System.Web.UI.WebControls.EntityDataSourceView.ConvertWCProperty(IDictionary values, Dictionary`2 convertedValues, List`1 visitedProperties, PropertyDescriptor pd, ParameterCollection referenceParameters, Dictionary`2& exceptions)"

Here is my code:

<asp:EntityDataSource ID="ordersDS" runat="server" ConnectionString="name=oscEnties" 
        DefaultContainerName="oscEnties" EnableDelete="False" EnableInsert="True" EnableUpdate="True" 
        EntitySetName="i_orders" Include="orderparts"
    </asp:EntityDataSource> 
    <asp:EntityDataSource ID="orderpartDS" runat="server" ConnectionString="name=oscEnties" 
        DefaultContainerName="oscEnties" EnableDelete="false" EnableInsert="True" EnableUpdate="True" 
        EntitySetName="i_orderpart" Where="it.order.orderid==@orderid"
        <InsertParameters> 
            <asp:Parameter Name="order.orderid" Type="Int32" /> 
        </InsertParameters> 
    </asp:EntityDataSource> 
     
     
    <telerik:RadGrid ID="ordersGrid" runat="server" ShowGroupPanel="True" GridLines="None" 
        OnItemCommand="ordersGrid_ItemCommand" AllowAutomaticInserts="True" DataSourceID="ordersDS" 
        AllowFilteringByColumn="True" AllowAutomaticUpdates="true" AllowSorting="True" 
        AutoGenerateColumns="False"
        <HeaderContextMenu> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </HeaderContextMenu> 
        <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true"
            <Selecting AllowRowSelect="true" /> 
        </ClientSettings> 
        <MasterTableView GroupLoadMode="client" AutoGenerateColumns="False" DataKeyNames="orderid" 
            CommandItemDisplay="Top"
            <DetailTables> 
                <telerik:GridTableView DataSourceID="orderpartDS" DataKeyNames="orderpartid" AutoGenerateColumns="false" 
                    AllowAutomaticUpdates="true" AllowAutomaticInserts="true" CommandItemDisplay="Top" 
                    AllowFilteringByColumn="false"
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="orderid" MasterKeyField="orderid" /> 
                    </ParentTableRelation> 
                    <NoRecordsTemplate> 
                        Hittade inga orderdelar 
                    </NoRecordsTemplate> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="orderpartid" DataType="System.Int32" HeaderText="ID" 
                            ReadOnly="True" SortExpression="orderpartid" UniqueName="orderpartid"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ordername" HeaderText="Namn" SortExpression="ordername" DataType="System.String" 
                            UniqueName="ordername"
                        </telerik:GridBoundColumn> 
                        <telerik:GridDateTimeColumn DataField="orderdate" DataType="System.DateTime" DataFormatString="{0:d}" 
                            HeaderText="Ankommande" UniqueName="orderdate" SortExpression="orderdate"
                        </telerik:GridDateTimeColumn> 
                        <telerik:GridDateTimeColumn DataField="shippingdate" DataType="System.DateTime" DataFormatString="{0:d}" 
                            HeaderText="Ankommande" UniqueName="shippingdate" SortExpression="shippingdate"
                        </telerik:GridDateTimeColumn> 
                        <telerik:GridDateTimeColumn DataField="arrivaldate" DataType="System.DateTime" DataFormatString="{0:d}" 
                            HeaderText="Ankommande" UniqueName="arrivaldate" SortExpression="arrivaldate"
                        </telerik:GridDateTimeColumn> 
                        <telerik:GridNumericColumn DataField="currency" DataType="System.Double" HeaderText="Växelkurs" 
                            UniqueName="currency" SortExpression="currency" NumericType="Number" KeepNotRoundedValue="true"
                        </telerik:GridNumericColumn> 
                        <telerik:GridNumericColumn DataField="freightcost" DataType="System.Double" HeaderText="Fraktkostnad" 
                            UniqueName="freightcost" SortExpression="freightcost" NumericType="Number" KeepNotRoundedValue="true"
                        </telerik:GridNumericColumn> 
                        <telerik:GridNumericColumn DataField="order.orderid" DataType="System.Int32" HeaderText="OrderId" 
                            UniqueName="order.orderid" SortExpression="order.orderid" Visible="true" ReadOnly="false"
                        </telerik:GridNumericColumn> 
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                            <ItemStyle CssClass="MyImageButton" /> 
                        </telerik:GridEditCommandColumn> 
                    </Columns> 
                    <EditFormSettings ColumnNumber="2" CaptionFormatString="Ändra orderdel"
                        <FormTableItemStyle Wrap="False"></FormTableItemStyle> 
                        <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> 
                        <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="1" BackColor="White" 
                            Width="100%" /> 
                        <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" BackColor="White" /> 
                        <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                        <EditColumn ButtonType="ImageButton" InsertText="Lägg till" UpdateText="Uppdatera" 
                            UniqueName="EditCommandColumn1" CancelText="Avbryt"
                        </EditColumn> 
                    </EditFormSettings> 
                </telerik:GridTableView> 
            </DetailTables> 
            <NoRecordsTemplate> 
                Hittade inga ordrar 
            </NoRecordsTemplate> 
            <Columns> 
                <telerik:GridBoundColumn DataField="orderid" DataType="System.Int32" HeaderText="ID" 
                    ReadOnly="True" SortExpression="orderid" UniqueName="orderid"
                </telerik:GridBoundColumn> 
                <telerik:GridCheckBoxColumn DataField="open" DataType="System.SByte" HeaderText="Öppen för best." 
                    SortExpression="open" UniqueName="open"
                </telerik:GridCheckBoxColumn> 
                <telerik:GridBoundColumn DataField="ordername" HeaderText="Namn" SortExpression="ordername" 
                    UniqueName="ordername"
                </telerik:GridBoundColumn> 
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                    <ItemStyle CssClass="MyImageButton" /> 
                </telerik:GridEditCommandColumn> 
            </Columns> 
            <EditFormSettings ColumnNumber="2" CaptionDataField="ordername" CaptionFormatString="Ändra pÃ¥ order: {0}"
                <FormTableItemStyle Wrap="False"></FormTableItemStyle> 
                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> 
                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="1" BackColor="White" 
                    Width="100%" /> 
                <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" BackColor="White" /> 
                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                <EditColumn ButtonType="ImageButton" InsertText="Lägg till" UpdateText="Uppdatera" 
                    UniqueName="EditCommandColumn1" CancelText="Avbryt"
                </EditColumn> 
            </EditFormSettings> 
        </MasterTableView> 
        <ClientSettings AllowDragToGroup="True"
        </ClientSettings> 
        <FilterMenu> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </FilterMenu> 
    </telerik:RadGrid> 

cs-file:
  public partial class Orders : System.Web.UI.Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!IsPostBack) 
                orderpartDS.WhereParameters.Add(new SessionParameter() { Name = "orderid", SessionField = "orderid", Type = TypeCode.Int32 }); 
        } 
 
        protected void ordersGrid_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
        { 
 
            if (e.CommandName == RadGrid.PerformInsertCommandName) 
            { 
                if (e.Item.OwnerTableView.DataSourceID == "orderpartDS"
                { 
                    GridDataItem parentItem = (GridDataItem)(e.Item.OwnerTableView.ParentItem); 
 
                    if (parentItem != null
                    { 
                        string orderId = parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["orderid"].ToString(); 
                        orderpartDS.InsertParameters["order.orderid"].DefaultValue = orderId; 
                    } 
                } 
            } 
        } 
    } 

The last bit with insertParameters is only a guess from my side, seeing others having problems with this using sql but it might not apply to entitys?

I also attached a screenshot of the relevant entities.
Im using asp.net 3.5 sp1 with a mysql-adapter.
Telerik.Web.UI 2009.3.1314.35

Veli
Telerik team
 answered on 28 Jan 2010
3 answers
188 views
Hi,

I am using the RadGird control to display records. If try filtering the records using the column filters, I get only a handful of filtering options.

I am attaching a snapshot of the problem UI named "Problem UI.jpg" here and an UI working fine named "Proper UI.jpg".

NOTE:
- The problem UI is fetching about 1400 records, whereas the UI working fine is fetching around 20 records.

Any help or suggestions on the issue is highly appreciated.

Thanks
Princy
Top achievements
Rank 2
 answered on 28 Jan 2010
1 answer
64 views
I've taken my data (a list of clients and sub clients)... and converted it to a List<ClientData> where ClientData has three properties: ClientID (int), ParentID (int?), ClientName (string).

Top level clients have ParentID as null.  Sub-clients have ParentID set to the ClientID of their parent.

I bind this list to the RadTreeView and get a linear list of all the clients (in proper order), but no "tree view" or "noding" at all. :(  Please advise what the heck I'm doing wrong!!!

 

 

 

<telerik:radtreeview id="clientTree" runat="server" skin="Vista" width="100%" showlineimages="true" height="300px" maxdatabinddepth="2">  
            <databindings> 
                <telerik:radtreenodebinding textfield="ClientName" valuefield="ClientID" /> 
            </databindings> 
        </telerik:radtreeview> 

ClientTree.DataFieldID = "ClientID";  
 
ClientTree.DataFieldParentID = "ParentID";  
 
ClientTree.DataValueField = "ClientID";  
 
ClientTree.DataTextField = "ClientName";  
 
ClientTree.DataSource = parsed  (the List<ClientData>)
 
ClientTree.DataBind();  
 


Pleas

 

Yana
Telerik team
 answered on 28 Jan 2010
1 answer
90 views
I have a simple grid with paging that displays a few hundred records that are pulled from OnNeedDataSource. There is also a search box at the top of the page that when used retrieves a subset of the records. That all works well.

The issue develops if the search returns enough records that they span more than 1 page. The items that come back are correct and the number of pages are correct but if you click to change pages the grid rebinds and the second page is back to the full record set.

Is there a way to not have the grid rebind on a page switch in this situation?

thanks
Yavor
Telerik team
 answered on 28 Jan 2010
1 answer
155 views
Hi,
I'm upgrading the RadEditorMOSS solution on my environment from version 4.1.0 to 4.5.6.
There is a problem on the existing instances of the webpart "Telerik RadEditor for MOSS" v.4.1.0 after the upgrade.
They show the error:
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.

Indeed, by adding the files version 4.1.0 to the GAC.
    RadEditor.Net2.dll
    RadEditorSharePoint.dll
    RadSpell.Net2.dll
Plus safe control entries on web.config, it works again.
Is there any way to get the 'old' webparts working correctly with version 4.5.6?

Thanks for the help.
Stanimir
Telerik team
 answered on 28 Jan 2010
1 answer
96 views
Hi Telerik Team,

                  I am working with RadGrid and RadioButton, Dropdown and a RadMaskedTextBox as Columns in a User Control. Dynamically changing the Mask of RadMaskedTextBox according to the items selected in dropdown. But when i am saving the data which is incomplte of the mask (such as (143) 222-3__3) is not giving any validation. So can you please give me your suggestions on this. If any other approaches they are also welcome.


Thanks in Advance
------------------------
K RAMU
Yavor
Telerik team
 answered on 28 Jan 2010
3 answers
159 views
I have seen the examples for putting a required field validator on textboxes but the same convention does not work for the dropdowns. Here is what we have and we need to get this to work with the dropdown. There isnt a DropDownControl for us to use this with a dropdown as there is with a textbox.

Dim

 

Service As GridTextBoxColumnEditor = CType(item.EditManager.GetColumnEditor("Service"), GridTextBoxColumnEditor)

 

 

Dim YCell As TableCell = CType(Service.TextBoxControl.Parent, TableCell)

 

 

Dim rfv1 As New RequiredFieldValidator()

 

Service.TextBoxControl.ID =

"Service"

 

rfv1.ControlToValidate = Service.TextBoxControl.ID

rfv1.ErrorMessage =

"Please select a Service"

 

YCell.Controls.Add(rfv1)

http://www.telerik.com/help/aspnet-ajax/grdvalidation.html (taken from here)

Please let us know what the solution would be for this scenario to change the code above from a textbox to a dropdown. Thanks.
Yavor
Telerik team
 answered on 28 Jan 2010
4 answers
500 views
I am using RadGrid which binds a stored procedure call to 1 DataSet.  The first column of the DataSet is "Supervisor" which I have set a grouping on.  All of the Supervisors are grouping correctly and works great.  However, I would like to add a Footer row to the bottom of each section of Supervisor Groupings.  Additionally, I would like to have a summary row for the entire RadGrid at the bottom.  I've added the appropriate  RadGrid.ShowFooter,  RadGrid.MasterTableView.ShowFooter  and  RadGrid.MasterTableView.ShowGroupFooter values to true.

Finally to my question.  For each Supervisor "group" section of data being returned from the stored procedure, I have the Footer summary row with custom calculations performed in the sproc itself.  At this point, all I want to do is display the results of that sproc as the Footer.  Unfortunately, the data is presumed to be part of the GridDataItems and not a GridFooterItem.  How do I configure the sproc and the RadGrid to presume the last row of each "group" is the Footer summary row?

Thanks in advance.
Yavor
Telerik team
 answered on 28 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?