Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
2.2K+ views
heey guys
I got this fu... error but i don't know why I checked every thing in my class and code behind still don't know why ..

Error message Type 'Telerik.Web.UI.GridBoundColumn' does not have a public property named 'Columns'.(Cod Line 41)

Code : 
<%@ Page Title="" Language="C#" MasterPageFile="~/ABBMaster.Master" AutoEventWireup="true" CodeBehind="EmployeGrid.aspx.cs" Inherits="HolidayTracker.Employe.EmployeGrid" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="MainRegionContentPlaceHolder" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" ShowStatusBar="True" DataSourceID="SqlDataSource1" runat="server" AutoGenerateColumns="False" PageSize="7"
        AllowSorting="True" AllowPaging="True" GridLines="None" CellSpacing="0">
        <PagerStyle Mode="NumericPages" />
        <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="DepartmentId" AllowMultiColumnSorting="true">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="UserId" DataSourceID="SqlDataSource2" Width="100%" runat="server">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="DepartmentId" MasterKeyField="DepartmentId" />
                    </ParentTableRelation>
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="Name" DataSourceID="SqlDataSource2" Width="100%" runat="server">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="Name" MasterKeyField="Name" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn SortExpression="FromData" HeaderText="From Date" HeaderButtonType="TextButton" DataField="FromDate"                                                        UniqueName="FromDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="ToDate" HeaderText="To Date" HeaderButtonType="TextButton" DataField="ToDate" UniqueName="ToDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="WorkingTime" HeaderText="Working Time" HeaderButtonType="TextButton" DataField="WorkingTime"                                                UniqueName="WorkingTime">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="VacationDays" HeaderText="Vacation Days" HeaderButtonType="TextButton" DataField="VacationDays"                                             UniqueName="VacationDays">  
                                </ telerik:GridBoundColumn>
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
                        <telerik:GridBoundColumn SortExpression="Name" HeaderText="Name" HeaderButtonType="TextButton" DataField="Name" UniqueName="Name">
                        </telerik:GridBoundColumn>
                   </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridBoundColumn SortExpression="DepartmentId" HeaderText="DepartmentId" HeaderButtonType="TextButton" DataField="DepartmentId"                                             UniqueName="DepartmentId">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="Name" HeaderText="Department Name" HeaderButtonType="TextButton" DataField="Name" UniqueName="Name">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HolidayTrackerConnectionString %>" SelectCommand="SELECT [DepartmentId], [Name] FROM [HtDepartment]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:HolidayTrackerConnectionString %>" SelectCommand="SELECT * FROM [AnnualVacationView] ORDER BY [UserId], [Name]"></asp:SqlDataSource>
</asp:Content>
code behind 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace HolidayTracker.Employe
{
    public partial class EmployeGrid : System.Web.UI.Page
    {
           protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadGrid1.MasterTableView.Items[0].Expanded = true;
                RadGrid1.MasterTableView.Items[0].ChildItem.NestedTableViews[0].Items[0].Expanded = true;
            }
        }
 
    }
}


as always thanks for your help and fast answers ^^ 
Nikola
Top achievements
Rank 2
 answered on 26 Oct 2012
1 answer
126 views
Hi team,
how we can reset the grid setting to the default after loading the saved settings.
we want to have a "Reset" column which return the grid to the default settings.
Regards
Ahmed Salem
Tsvetoslav
Telerik team
 answered on 26 Oct 2012
1 answer
323 views
Hi 

How I can override RadGrid to Data bind a list of ExpandoObjects.

Sample Code :

List<ExpandoObject> viewList = new List<ExpandoObject>();
for (int i = 0; i < 100; i++)
{
    dynamic view = new ExpandoObject();
    var p = view as IDictionary<String, object>;
    p["LatName"] = i * 2;
    p["Name"] = i;
    viewList.Add(view);
}
RadGrid1.DataSource = viewList;
RadGrid1.DataBind();
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" CellSpacing="0"
    GridLines="None">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter column column"
                  HeaderText="Name" UniqueName="column">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Tsvetoslav
Telerik team
 answered on 26 Oct 2012
2 answers
133 views
Hi,
I have a rad grid...
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateSelectColumn="True" CellSpacing="0"
                        GridLines="Horizontal" AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource"
                        AllowAutomaticUpdates="false" AllowPaging="false" AllowSorting="false" Width="100%">
                        <SortingSettings EnableSkinSortStyles="false" />
                        <MasterTableView DataKeyNames="Code" PageSize="20" Width="100%">
                            <Columns>
                                <telerik:GridTemplateColumn UniqueName="txtQTY" HeaderText="Quantity">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" ID="QTYtextbox" Width="40px" Enabled="true" Text='<%# Bind("QTY") %>'> </asp:TextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="Code" HeaderText="Code" UniqueName="Code" FilterControlAltText="Filter Code column"
                                    SortExpression="Code" ItemStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name" FilterControlAltText="Filter Name column"
                                    SortExpression="Name" ItemStyle-Width="200px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Units" HeaderText="Units" UniqueName="Units"
                                    FilterControlAltText="Filter Units column" SortExpression="Units" ItemStyle-Width="25px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="QTY" HeaderText="QTY" UniqueName="colQTY" Visible="True"
                                    ItemStyle-Width="25px">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>

It is populated using data binding and all the columns show data...
Protected Sub RadGrid1_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
    'Loads Data into the table
    Dim ordlist As New dbrcOrdEst(Session("ConnectionString"))
    Dim dt As DataTable = ordlist.ListOrderEstimates(498)
    RadGrid1.DataSource = dt
End Sub

However what I want to do is take my textbox column, and return the values back into the database, however I can't get data out of the Textboxes, I know how to manipulate the data once I've got it, but I can't get it. This code does what I want on standard columns but not on textbox columns what am I missing 
Protected Sub btnImport_Click(sender As Object, e As System.EventArgs) Handles btnImport.Click
    For Each item As GridDataItem In RadGrid1.Items
        Dim value As String
        value = item.Cells(2).Text
'DB Functionality
    Next
End Sub

Thanks in advance for your help, Ryan 
Tsvetoslav
Telerik team
 answered on 26 Oct 2012
1 answer
387 views
Hi,

I am trying to use the following code to create a hierarchical grid.  It works all the way until the grid is expanded to the UserLocationVendorModel GridView (bolded code below).  This gridview (table) needs two keys (LocationID and VendorName) passed from the selection on the third level.  Could you tell me if I am missing something?  I have attached a screenshot of how the grid is not working on the last level.
 
VB.NET Code:

DefineGridStructure is called in the Page_Load event of the ASP.Net page.

 Private Sub DefineGridStructure()

        Dim RadGrid4 As RadGrid = New RadGrid

        RadGrid4.DataSourceID = "SqlDataSource1"
        RadGrid4.MasterTableView.DataKeyNames = New String() {"LocationID"}
        RadGrid4.Width = Unit.Percentage(100)
        RadGrid4.PageSize = 15
        RadGrid4.AllowPaging = True
        RadGrid4.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
        RadGrid4.AutoGenerateColumns = False
        RadGrid4.Skin = "Outlook"


        'Add Location table
        RadGrid4.MasterTableView.Width = Unit.Percentage(100)


        Dim boundColumn As GridBoundColumn
        boundColumn = New GridBoundColumn()
        RadGrid4.MasterTableView.Columns.Add(boundColumn)
        boundColumn.DataField = "LocationID"
        boundColumn.HeaderText = "LocationID"
        boundColumn = New GridBoundColumn()
        RadGrid4.MasterTableView.Columns.Add(boundColumn)
        boundColumn.DataField = "Description"
        boundColumn.HeaderText = "Description"
        boundColumn = New GridBoundColumn()
        RadGrid4.MasterTableView.Columns.Add(boundColumn)
        boundColumn.DataField = "ParentId"
        boundColumn.HeaderText = "ParentId"
        boundColumn = New GridBoundColumn()
        RadGrid4.MasterTableView.Columns.Add(boundColumn)
        boundColumn.DataField = "EditStatus"
        boundColumn.HeaderText = "EditStatus"
        boundColumn = New GridBoundColumn()
        RadGrid4.MasterTableView.Columns.Add(boundColumn)
        boundColumn.DataField = "ModificationSeq"
        boundColumn.HeaderText = "ModificationSeq"
        RadGrid4.AllowFilteringByColumn = True


        'Add UserLocation table
        Dim tableUserLocation As New GridTableView(RadGrid4)
        tableUserLocation.DataSourceID = "SqlDataSource2"
        tableUserLocation.DataKeyNames = New String() {"LocationID"}
        tableUserLocation.Width = Unit.Percentage(100)
        Dim relationFields As GridRelationFields = New GridRelationFields()
        relationFields.MasterKeyField = "LocationID"
        relationFields.DetailKeyField = "LocationID"
        tableUserLocation.ParentTableRelation.Add(relationFields)


        RadGrid4.MasterTableView.DetailTables.Add(tableUserLocation)


        'Add Columns
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "LocationID"
        boundColumn.HeaderText = "LocationID"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "Member"
        boundColumn.HeaderText = "Member"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "HasChild"
        boundColumn.HeaderText = "HasChild"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "Kount"
        boundColumn.HeaderText = "Kount"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "Pct"
        boundColumn.HeaderText = "Pct"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "TotalCounter"
        boundColumn.HeaderText = "TotalCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "PrinterCounter"
        boundColumn.HeaderText = "PrinterCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "CopyCounter"
        boundColumn.HeaderText = "CopyCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "FaxCounter"
        boundColumn.HeaderText = "FaxCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocation.Columns.Add(boundColumn)
        boundColumn.DataField = "ScanCounter"
        boundColumn.HeaderText = "ScanCounter"


        'Add UserLocationVendor table
        Dim tableUserLocationVendor As New GridTableView(RadGrid4)
        tableUserLocationVendor.DataSourceID = "SqlDataSource3"
        tableUserLocationVendor.DataKeyNames = New String() {"LocationID"}
        tableUserLocationVendor.Width = Unit.Percentage(100)
        Dim relationFields2 As GridRelationFields = New GridRelationFields()


        relationFields2.MasterKeyField = "LocationID"
        relationFields2.DetailKeyField = "LocationID"
        tableUserLocationVendor.ParentTableRelation.Add(relationFields2)
        tableUserLocation.DetailTables.Add(tableUserLocationVendor)


        'Add columns
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "LocationID"
        boundColumn.HeaderText = "LocationID"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "VendorName"
        boundColumn.HeaderText = "VendorName"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "Kount"
        boundColumn.HeaderText = "Kount"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "Pct"
        boundColumn.HeaderText = "Pct"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "TotalCounter"
        boundColumn.HeaderText = "TotalCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "PrinterCounter"
        boundColumn.HeaderText = "PrinterCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "CopyCounter"
        boundColumn.HeaderText = "CopyCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "FaxCounter"
        boundColumn.HeaderText = "FaxCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendor.Columns.Add(boundColumn)
        boundColumn.DataField = "ScanCounter"
        boundColumn.HeaderText = "ScanCounter"


        'Add UserLocationVendorModel table
        Dim tableUserLocationVendorModel As New GridTableView(RadGrid4)
        tableUserLocationVendorModel.DataSourceID = "SqlDataSource4"
        tableUserLocationVendorModel.DataKeyNames = New String() {"LocationID", "VendorName"}
        tableUserLocationVendorModel.Width = Unit.Percentage(100)
        Dim relationFields3 As GridRelationFields = New GridRelationFields
        relationFields3.MasterKeyField = "LocationID,VendorName"
        relationFields3.DetailKeyField = "LocationID,VendorName"
        tableUserLocationVendorModel.ParentTableRelation.Add(relationFields3)
        tableUserLocationVendor.DetailTables.Add(tableUserLocationVendorModel)



        'Add columns
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "LocationID"
        boundColumn.HeaderText = "LocationID"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "VendorName"
        boundColumn.HeaderText = "VendorName"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "ModelName"
        boundColumn.HeaderText = "ModelName"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "Kount"
        boundColumn.HeaderText = "Kount"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "Pct"
        boundColumn.HeaderText = "Pct"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "TotalCounter"
        boundColumn.HeaderText = "TotalCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "PrinterCounter"
        boundColumn.HeaderText = "PrinterCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "CopyCounter"
        boundColumn.HeaderText = "CopyCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "FaxCounter"
        boundColumn.HeaderText = "FaxCounter"
        boundColumn = New GridBoundColumn()
        tableUserLocationVendorModel.Columns.Add(boundColumn)
        boundColumn.DataField = "ScanCounter"
        boundColumn.HeaderText = "ScanCounter"


        Me.PlaceHolder1.Controls.Add(RadGrid4)


End Sub

Aspx Code:


        <telerik:RadGrid ID="RadGrid4" runat="server" gridLines="Both">
             </telerik:RadGrid>
                         
             
                    <div style="width:730px;">
                    <asp:SqlDataSource ID="SqlDataSource1" 
                          ConnectionString="<%$ ConnectionStrings:DSN %>"
                          ProviderName="<%$ ConnectionStrings:DSN.ProviderName %>"
                          SelectCommand="GetLocationsByParentLocationId" runat="server" 
                                    SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:SessionParameter Name="CompanyID" SessionField="CompanyID" />
                                        <asp:SessionParameter Name="LocationID" SessionField="InitialLocationID" />
                                   </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource2" 
                          ConnectionString="<%$ ConnectionStrings:DSN %>"
                          ProviderName="<%$ ConnectionStrings:DSN.ProviderName %>"
                          SelectCommand="Report_PopulationByUserLocation_New_Test" runat="server"
                                    SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:SessionParameter Name="aiUserUniqueID" SessionField="UserID" />                                       
                                        <asp:Parameter Name="LocationID" Type="int32" />
                                        <asp:SessionParameter Name="asCompanyID" SessionField="CompanyID" />
                                    </SelectParameters>
                    </asp:SqlDataSource>
                                        <asp:SqlDataSource ID="SqlDataSource3" 
                          ConnectionString="<%$ ConnectionStrings:DSN %>"
                          ProviderName="<%$ ConnectionStrings:DSN.ProviderName %>"
                          SelectCommand="Report_PopulationByUserLocationVendor_New_Test" runat="server"
                                    SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:SessionParameter Name="aiUserUniqueID" SessionField="UserID" />
                                        <asp:Parameter Name="LocationID" Type="int32" />
                                    </SelectParameters>
                    </asp:SqlDataSource>
                                        <asp:SqlDataSource ID="SqlDataSource4" 
                          ConnectionString="<%$ ConnectionStrings:DSN %>"
                          ProviderName="<%$ ConnectionStrings:DSN.ProviderName %>"
                          SelectCommand="Report_PopulationByUserLocationVendorModel_New_Test" runat="server"
                                    SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:SessionParameter Name="aiUserUniqueID" SessionField="UserID" />
                                        <asp:Parameter Name="LocationID" Type="int32" />
                                        <asp:Parameter Name="VendorName" Type="string" />
                                        <asp:SessionParameter Name="asURL" SessionField="URL" />
                                    </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    </telerik:RadAjaxManager>

Tsvetoslav
Telerik team
 answered on 26 Oct 2012
4 answers
275 views
I'm running into a number of issues trying to do validation of controls in a popup form template of a radGrid:

1) None of my client-side validation funtions are firing
2) I cannot get the NEW value of the radEditor in my server-side custom validation function
3) When the insert form is redisplayed with errors, the content of the radEditor displays the original value, not the new value (changes are lost)

I'm using IE 9.0, and radControls Q3 2012.

This is the code for two of my editor controls that are having an issue (and the update button):
<telerik:RadTextBox ID="rtbTItle" runat="server" Width="400" TextMode="SingleLine" Text='<%# DataBinder.Eval(Container, "DataItem.Title") %>' Skin="WebBlue">
</telerik:RadTextBox>
<asp:RequiredFieldValidator ID="rfvTitle" runat="server" ControlToValidate="rtbTitle"
    ErrorMessage="You must enter a Title" ValidationGroup="vgEditor" ForeColor="Red" Font-Bold="true">*</asp:RequiredFieldValidator>
<asp:CustomValidator ID="cvTitle" runat="server" ControlToValidate="rtbTitle"
    ClientValidationFunction="cvTitle_Validator" OnServerValidate="cvTitle_ServerValidate" EnableClientScript="true"
    ErrorMessage="Title cannot contain 'x'" ValidationGroup="vgEditor" ForeColor="Red" Font-Bold="true">x</asp:CustomValidator>
 
 
<telerik:RadEditor ID="reItemText" runat="server" BorderStyle="None"
    OnClientLoad="reItemText_OnClientLoad" OnClientModeChange="reItemText_OnClientModeChange"
    Width="800" Height="300" AutoResizeHeight="false" EnableResize="false" ToolsWidth="800"
    ContentAreaMode="Div" Skin="WebBlue" Content='<%# DataBinder.Eval(Container, "DataItem.ItemText") %>'>
</telerik:RadEditor>
<asp:CustomValidator ID="cvItemText" runat="server" ControlToValidate="reItemText"
    ClientValidationFunction="cvItemText_Validator" OnServerValidate="cvItemText_ServerValidate" EnableClientScript="true"
    ErrorMessage="Item Text is required" ValidateEmptyText="true" ValidationGroup="vgEditor" ForeColor="Red" Font-Bold="true">*</asp:CustomValidator>
 
 
<asp:Button ID="btnUpdate" runat="server" ValidationGroup="vgEditor" CausesValidation="true" Text='<%# IIf(TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>' CommandName='<%# IIf(TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>' />

These are my client-side validation functions (neither of which gets fired):
function cvItemText_Validator( sender, args ) {
  console.log( "cvItemText_Validator" );
}
 
function cvTitle_ServerValidate( sender, args ) {
  console.log( "cvTitle_ServerValidate" );
}

And these are my server-side validation functions:
Protected Sub cvItemText_ServerValidate(source As Object, args As System.Web.UI.WebControls.ServerValidateEventArgs)
    System.Diagnostics.Debug.WriteLine("Admin_ManageNews:cvItemText_ServerValidate")
    System.Diagnostics.Debug.WriteLine(String.Format("  ItemText: {0}", args.Value))
    Dim oItem As GridEditableItem = DirectCast(DirectCast(source, CustomValidator).NamingContainer, GridEditableItem)
    Dim oEditor As RadEditor = DirectCast(oItem.FindControl("reItemText"), RadEditor)
    System.Diagnostics.Debug.WriteLine(String.Format("  ItemText: {0}", oEditor.Content))
 
End Sub
 
Protected Sub cvTitle_ServerValidate(source As Object, args As System.Web.UI.WebControls.ServerValidateEventArgs)
    System.Diagnostics.Debug.WriteLine("Admin_ManageNews:cvTitle_ServerValidate")
    System.Diagnostics.Debug.WriteLine(String.Format("  Title: {0}", args.Value))
    Dim oItem As GridEditableItem = DirectCast(DirectCast(source, CustomValidator).NamingContainer, GridEditableItem)
    Dim oRTB As RadTextBox = DirectCast(oItem.FindControl("rtbTitle"), RadTextBox)
    System.Diagnostics.Debug.WriteLine(String.Format("  Title: {0}", oRTB.Text))
End Sub

Both of the debug statements for the cvTitle validator display the correct value for the Title field, but neither debug statement for the cvItemText validator displays the new values, they display the old value.
Tsvetoslav
Telerik team
 answered on 26 Oct 2012
3 answers
188 views

hi, i have a grid with detailtable, loading in detailtablebind event, when i push a button i want loop all selected row in detail table also not expanded...
post some code...

<telerik:RadGrid runat="server" ID="rgrFatturazione" Skin="Vista"
                   AllowPaging="True" AllowSorting="True" GridLines="None" 
                   style="margin-top: 200px; margin-left:27px;"  Width="900px" 
                   ShowGroupPanel="True" oncolumncreated="rgrFatturazione_ColumnCreated" AllowMultiRowSelection="true"
                   ondetailtabledatabind="rgrFatturazione_DetailTableDataBind" 
               onitemcommand="rgrFatturazione_ItemCommand" 
               onitemdatabound="rgrFatturazione_ItemDataBound">
                   <GroupingSettings CaseSensitive="false" />
                   <PagerStyle Mode="NumericPages"/>
                   <ClientSettings>
                   <Selecting  AllowRowSelect="true"/>
                   </ClientSettings>
                   <MasterTableView ShowHeadersWhenNoRecords="true" >
                        <DetailTables>
                           <telerik:GridTableView Name="Commessa" Width="100%">
                               <Columns>
                                      <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridClientSelectColumn UniqueName="checkCom"/>
                               </Columns>
                               <DetailTables>
                                   <telerik:GridTableView Name="Rapportini" Width="100%">
                                       <Columns>
                                                   <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                                                   </telerik:GridBoundColumn>
                                                   <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                                                   </telerik:GridBoundColumn>
                                                   <telerik:GridTemplateColumn UniqueName="colCheckRap" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                       <ItemTemplate>
                                                           <asp:CheckBox runat="server" ID="checkRap" />
                                                       </ItemTemplate>
                                                   </telerik:GridTemplateColumn>                                                                                                     
                                                   <telerik:GridTemplateColumn UniqueName="colView" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                       <ItemTemplate>
                                                           <asp:Image runat="server" ID="linkView" ImageUrl="~/images/Zoom.png">
                                                           </asp:Image>
                                                           <telerik:RadToolTip runat="server" Width="300" Height="300" RenderInPageRoot="true" ShowEvent="OnMouseOver"
                                                                   HideEvent="ManualClose" HideDelay="2" ID="Tooltip" Position="TopRight" Animation="Resize"
                                                                   RelativeTo="Element" >
                                                           </telerik:RadToolTip>
                                                       </ItemTemplate>
                                                   </telerik:GridTemplateColumn>
                                                   <telerik:GridTemplateColumn UniqueName="colView" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                       <ItemTemplate>
                                                           <asp:LinkButton runat="server" ID="linkRappo" Text="Rapportino" CommandName="Rapportino">
                                                           </asp:LinkButton>
                                                       </ItemTemplate>
                                                   </telerik:GridTemplateColumn>
                                       </Columns>
                                   </telerik:GridTableView>
                               </DetailTables>
                           </telerik:GridTableView>
                   </DetailTables>                  
                   <Columns>
                           <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                           </telerik:GridBoundColumn>
                           <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                           </telerik:GridBoundColumn>
                   </Columns>
                   </MasterTableView>
           </telerik:RadGrid>
        
           <br />
           <asp:Button runat="server" ID="btnFattura" Text="Fattura" 
               onclick="btnFattura_Click"/>
protected void rgrFatturazione_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
       {
           GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
           if (e.DetailTableView.Name == "Commessa")
           {
               string Cliente2 = dataItem["Codice Cliente"].Text;
               e.DetailTableView.DataSource = this._LoadCommesse(int.Parse(Cliente2));
           }
           else
           {
               string Cliente3 = dataItem["Cliente Commessa"].Text;
               string Commessa = dataItem["Commessa"].Text;
               e.DetailTableView.DataSource = this._LoadRapportini(Commessa, int.Parse(Cliente3));
           }
       }
}
i try this but doesn't work..
protected void btnFattura_Click(object sender, EventArgs e)
        {
            foreach (GridDataItem clienti in rgrFatturazione.MasterTableView.Items)
            {
                foreach (GridDataItem commesse in clienti.ChildItem.NestedTableViews[0].Items)
                {
                    foreach (GridDataItem rapportini in commesse.ChildItem.NestedTableViews[0].Items)
                    {
                          
                    }
                }
            }
        }
thanks!!
Princy
Top achievements
Rank 2
 answered on 26 Oct 2012
3 answers
108 views
Hi.
How I can access columns in a radgrid by javascript?
I need to change their width upon him by this method.

This are the columns.
 <Columns>
                    <radG:GridBoundColumn SortExpression="region_id" HeaderText="Region" HeaderButtonType="TextButton"
                        DataField="region_id">
                    </radG:GridBoundColumn>
                    <radG:GridBoundColumn SortExpression="qty" HeaderText="Qty" HeaderButtonType="TextButton"
                        DataField="qty">
                    </radG:GridBoundColumn>
                    <radG:GridBoundColumn SortExpression="status" HeaderText="Status" HeaderButtonType="TextButton"
                        DataField="status">
                    </radG:GridBoundColumn>
                  
                </Columns>

Princy
Top achievements
Rank 2
 answered on 26 Oct 2012
1 answer
73 views
Hi
   I am usng 2012.2.724.35 telerik version. I am facing one issue on telerik grid where on selection of row ( every second row only) has problem in highlighting. so odd rows are doing good but not even . browser version is IE 8. please see the attached image


Best Regards
Rizwan Bashir
Princy
Top achievements
Rank 2
 answered on 26 Oct 2012
2 answers
356 views
Hi team,
how we can reset the grid setting to the default after loading the saved settings.
we want to have a "Reset" column which return the grid to the default settings.
Regards.
Mohammed
Mohammed
Top achievements
Rank 2
 answered on 26 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?