Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
82 views
hi telerik
i want to my page knows that   opened in rad window (radwindow is its container)  or opening outside by typing url?
In other words i want to users cannot open pages instantly (prevent open outside of ranwindow)
 and be forced to view only via radwindow .
is it possible?
Georgi Tunev
Telerik team
 answered on 22 Jul 2009
1 answer
114 views
I am just trying to create a simple RadDoc inside a RadDocLayout that has some asp:TextBoxs and asp:Checkboxes. Some of the checkboxes are autopostback=true, so I wrapped the RadDockLayout inside a RadAjaxPanel. It kind of works ... most of the postbacks are AJAX calls (not full page postbacks). But if I move the doc window, then hit the checkbox (with AutoPostBack=true), it causes a full page postback rather than an AJAX call.

Am I doing something wrong? Is there an easy way to "ajaxify" a simple RadDock (I only want 1 movable window and dont even use the RadDockZone). Perhaps RadDock is not the right class if I just want a single movable "floating" window on my page (the RadWindow seems to be best for pointing to other URLs).

Thanks!
Pero
Telerik team
 answered on 22 Jul 2009
0 answers
100 views
Hi,

While I was searching in doc, I may have found errors :
http://www.telerik.com/help/aspnet/treeview/radtreeview-telerik.webcontrols.radtreenodebinding-enabled.html

It seams that the RadTreeNodeBinding documentation has been either rawly copied from RadMenuItemBinding or has generation errors (or may be outdated ?).

Anyway, I can't find the "ExpandMode" property in RadTreeNodeBinding members and all Remarks text are related to RadMenuItemBinding.

Sorry for bothering.

Thanks.


Dédé
Top achievements
Rank 1
 asked on 22 Jul 2009
1 answer
117 views
i have a rad grid that is populated by 2 linq datasources programmatically and i want to have sorting on the grid but it doesnt seem to want to sort properly when i click the header

is there anything that i can do?

cheers
Mira
Telerik team
 answered on 22 Jul 2009
6 answers
138 views
Hi,

I have a grid with a dropdowncolumn.
It works as expected - except in the situation when the "ID" is not available in the values list.

In this case the dropdown does not display "nothing" - instead it shows the first entry.
In "edit mode" I can understand this - it is some kind of a default.
But in display mode - where the content is rendered as some kind of text it is unexpected to display a "assumed value".

Regards

Manfred
ManniAT
Top achievements
Rank 2
 answered on 22 Jul 2009
1 answer
171 views
I have a grid with grouping enabled and also integrates a context menu to access editing and deleting of items.  However, when the records are grouped, the index being returned is incorrect as it takes into account the grouping header rows.  After a lot of research, I notice that all the examples in the forums use a different javascript method for the context menu than what is given in the Q1 2009 ASP.NET AJAX examples.  The biggest difference is that the row index is retrieved using eventargs.get_itemIndexHierarchial();  So, I tried to implement this method to no avail.  When implemented, that line of code actually errors and kicks the user out of the method.

Function RowContextMenu(sender, e)    
      var index = e.get_itemIndexHierarchical(); 
      document.getElementById("hdnGridClickedRowIndex").value = index; 
                                 
      var menu = <%= rmuContextMenu.ClientID %>;                   
                 
      menu.Show(e);    
                    
      e.cancelBubble = true;    
      e.returnValue = false;    
   
      if (e.stopPropagation)    
      {    
            e.stopPropagation();    
            e.preventDefault();    
      }    
      this.SelectRow(this.Rows[index].Control, true);    

I'm getting a bit frustrated by this and would love anyone's help.

Thanks
Sebastian
Telerik team
 answered on 22 Jul 2009
1 answer
212 views
Hey all,

I am trying to make a single pie chart, my SQL table with the values for the chart will be only one row, with many columns that hold the data.  However, when i add all the columns, it makes a whole bunch of pie charts with the value being 100%.  How do i make this all one pie? 
Vladimir Milev
Telerik team
 answered on 22 Jul 2009
1 answer
77 views
I'm trieng to get diffrent colors on diffrent groups.

.rsHorizontalHeaderTable th   
    {   
        color: Pink !important       
    }  
Set's the color for all.. :-(

<div class="rsInnerFix" style="overflow:hidden;">  
                            <table class="rsHorizontalHeaderTable" cellpadding="0" cellspacing="0" border="0" style="height:25px;width:100%;">  
                                <tr>  
                                    <th>G 1</th><th>G 2</th><th>G 3</th>  
                                </tr>  
                            </table>  
                        </div>  
Is it possible to get "G 1" Red, "G 2" Blue and "G 3" Green.

I tried to change in the "OnResourceHeaderCreated" but without any luck.

The only way (not jet tested) that I have is to use jQuery to itterate over th in the table with class rsHorizontalHeaderTable...

Benny
Top achievements
Rank 1
 answered on 22 Jul 2009
7 answers
216 views
Hi,

I am building my treeview in codebehind, with serverside callback. Some nodes contains ButtonLink with CommandName and CommandArgument filled (to allow richer node interaction).

Is there a way to create a "ItemCommand" event to handle the click on those ButtonLink ?

Thanks.
Dédé
Top achievements
Rank 1
 answered on 22 Jul 2009
1 answer
178 views
Hi, Telerik. I have a little problem. I'm trying to create a radgrid at runtime take definition of grid from a DB.
I haven't problem to show data, I'm able to create pop edit form but I'm not able to retrive modified data.
These is my code:

- this is ASCX code that define grid control

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="anagrafiche.ascx.vb" Inherits="GestioneAnagrafiche_anagrafiche" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<link href="../CSS/RadAnagrafiche.css" rel="stylesheet" type="text/css" /> 
 
<script type="text/javascript" src="../Griglie/Script/TelerikTools.js"></script> 
 
<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:RadAjaxLoadingPanel EnableEmbeddedSkins="False" Skin="3iSkin" ID="RadAjaxLoadingPanel1" runat="server" /> 
 
<telerik:RadGrid ID="RadGridAnagrafiche" EnableEmbeddedSkins="False" Skin="3iSkin" runat="server"   
    AllowAutomaticDeletes="False" AllowAutomaticUpdates="False" AllowAutomaticInserts="True"   
    AutoGenerateColumns="False" GridLines="None" EnableViewState="true">  
    <HeaderContextMenu EnableEmbeddedSkins="False" Skin="3iSkin" /> 
    <FilterMenu EnableEmbeddedSkins="False" Skin="3iSkin" /> 
    <PagerStyle Mode="NextPrevAndNumeric" /> 
 
    <MasterTableView Width="100%" HorizontalAlign="NotSet" AutoGenerateColumns="False" EditMode="PopUp" ShowFooter="true">  
        <Columns> 
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"   
                EditText="Modifica riga" EditImageUrl="../Griglie/Immagini/edit.gif"   
                UpdateText="Salva cambiamenti" UpdateImageUrl="../Griglie/Immagini/save.gif"   
                CancelText="Annulla Modifiche" CancelImageUrl="../Griglie/Immagini/cancel.gif" > 
                <ItemStyle CssClass="MyImageButton" Width="15px" /> 
            </telerik:GridEditCommandColumn> 
        </Columns> 
        <EditFormSettings ColumnNumber="1" CaptionFormatString="Modifica Record">  
            <FormTableItemStyle Wrap="False" /> 
            <FormCaptionStyle CssClass="EditFormHeader" /> 
            <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" /> 
            <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" /> 
            <FormTableAlternatingItemStyle Wrap="False" /> 
            <EditColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1" 
                InsertText="Nuovo Record"  InsertImageUrl="../Griglie/Immagini/piu.gif"   
                UpdateText="Aggiorna Record" UpdateImageUrl="../Griglie/Immagini/save.gif"   
                CancelText="Annulla Modifiche" CancelImageUrl="../Griglie/Immagini/cancel.gif" /> 
            <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow" /> 
        </EditFormSettings> 
 
    </MasterTableView> 
    <ClientSettings> 
        <ClientEvents OnRowDblClick="RowDblClick" /> 
    </ClientSettings> 
</telerik:RadGrid> 
 

- This is the code behind that generate grid colums

Imports System  
Imports System.Collections  
Imports System.ComponentModel  
Imports System.Data  
Imports System.Data.OleDb  
Imports System.Web  
Imports System.Web.SessionState  
Imports System.Web.UI  
Imports System.Web.UI.WebControls  
Imports System.Web.UI.HtmlControls  
 
Imports Telerik.Web.UI  
Imports System.Drawing  
Imports CalcolaScontoRiga  
Imports ITemplateEditColumn  
 
Partial Class GestioneAnagrafiche_anagrafiche  
    Inherits System.Web.UI.UserControl  
 
    Public Event AggiornataGriglia()  
 
    Private taAnaAcl As New dsRestrizioniTableAdapters.taTabGriglieAnaACL  
    Private taAnaGri As New GriglieTableAdapters.taTabGriglieAna  
    Private taAnaCol As New GriglieTableAdapters.taTabGriglieAnaColonne  
 
    Private GridSettings As New ParamGriglie.ParamGriglie  
    Private MyUtil As New General.General  
    Private Utility As New genericFunction  
 
    Private colTemplate As GridTemplateColumn  
    Private colBound As GridBoundColumn  
    Private colButton As GridButtonColumn  
    Private colDateTime As GridDateTimeColumn  
    Private colEdit As GridEditCommandColumn  
 
    Private DefaultColumnWidth As Integer = 50  
 
    Private NomeTabella As String 
    Private SqlRecuperoDati As String 
    Private SqlUpdateDati As String 
    Private ChiaveGriglia As String = "" 
 
    Dim dtAnaACL As dsRestrizioni.TabGriglieAnaACLDataTable  
    Dim dtAnaGri As Griglie.TabGriglieAnaDataTable  
    Dim dtAnaCol As Griglie.TabGriglieAnaColonneDataTable  
 
    Public Sub ReloadCarrello()  
        RaiseEvent AggiornataGriglia()  
    End Sub 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
 
 
        Dim idACL, grInsert, grEdit, grDelete, grEsporta As Integer 
        Dim CampoDb, TestoHeader As String 
        Dim Visibile, Editabile, Larghezza, Filtro, TipoDato, Ordine, IsKey As Integer 
 
        Dim ds As New Data.DataSet  
 
        If Not Utility.CheckSession(HttpContext.Current) Then Me.Response.Redirect("~/default.aspx")  
 
        Me.MyUtil.ConnectionString = GridSettings.DataConn  
        Me.MyUtil.DataBase = GridSettings.dbTypeData  
 
        dtAnaACL = New dsRestrizioni.TabGriglieAnaACLDataTable  
        dtAnaGri = New Griglie.TabGriglieAnaDataTable  
        dtAnaCol = New Griglie.TabGriglieAnaColonneDataTable  
 
        'In base al parametro TAB capisco quale tabella modificare  
        NomeTabella = Request.QueryString("TAB")  
 
        RadGridAnagrafiche.Columns.Clear()  
 
        colEdit = New GridEditCommandColumn  
        colEdit.ButtonType = GridButtonColumnType.ImageButton  
        colEdit.UniqueName = "EditCommandColumn" 
        colEdit.EditText = "Modifica riga" 
        colEdit.EditImageUrl = "../Griglie/Immagini/edit.gif" 
        colEdit.UpdateText = "Salva cambiamenti" 
        colEdit.UpdateImageUrl = "../Griglie/Immagini/save.gif" 
        colEdit.CancelText = "Annulla Modifiche" 
        colEdit.CancelImageUrl = "../Griglie/Immagini/cancel.gif" 
        colEdit.ItemStyle.CssClass = "MyImageButton" 
        colEdit.ItemStyle.Width = Unit.Pixel(15)  
 
        RadGridAnagrafiche.MasterTableView.Columns.Add(colEdit)  
 
        If (Not String.IsNullOrEmpty(NomeTabella)) Then 
 
            'Controllo se l'utente ha i permessi per Visualizzare/Inserire/Modificare i record  
            'Recupero i parametri della griglia  
            dtAnaACL = taAnaAcl.Get_GriglieAnaACL(NomeTabella, Me.Session("CodDip"))  
 
            If (dtAnaACL.Rows.Count = 1) Then 
 
                'Recupero i permessi associati a questa tabella  
                idACL = dtAnaACL.Rows(0).Item("id")  
                grInsert = dtAnaACL.Rows(0).Item("grInsert")  
                grEdit = dtAnaACL.Rows(0).Item("grEdit")  
                grDelete = dtAnaACL.Rows(0).Item("grDelete")  
                grEsporta = dtAnaACL.Rows(0).Item("grEsporta")  
 
                'Recupero i dati della griglia  
                dtAnaGri = taAnaGri.Get_TabGriglieAna(NomeTabella)  
                SqlRecuperoDati = dtAnaGri.Rows(0).Item("SQL")  
 
                'Recupero le colonne da visualizzare nella griglia  
                dtAnaCol = taAnaCol.Get_TabColGriglieAna(idACL)  
                If (dtAnaCol.Rows.Count > 0) Then 
 
                    For i = 0 To dtAnaCol.Rows.Count - 1  
 
                        CampoDb = dtAnaCol.Rows(i).Item("Campodb")  
                        TestoHeader = dtAnaCol.Rows(i).Item("Testoheader")  
                        IsKey = dtAnaCol.Rows(i).Item("isKey")  
                        Visibile = dtAnaCol.Rows(i).Item("Visible")  
                        Editabile = dtAnaCol.Rows(i).Item("Editable")  
                        Larghezza = dtAnaCol.Rows(i).Item("Widthcol")  
                        Filtro = dtAnaCol.Rows(i).Item("Filtro")  
                        TipoDato = dtAnaCol.Rows(i).Item("TipoDato")  
                        Ordine = dtAnaCol.Rows(i).Item("Ordine")  
 
                        If (IsKey = 1) And (i = 0) Then 
                            ChiaveGriglia = CampoDb.ToString  
                        ElseIf (IsKey = 1) And (i > 0) Then 
                            ChiaveGriglia += "," + CampoDb.ToString  
                        End If 
 
                        'A questo punto, aggiungo le colonne alla griglia  
                        RadGridAnagrafiche.AllowSorting = True 
 
                        Select Case TipoDato  
                            Case 1 'campo data  
                                If Editabile = 0 Then 
                                    colDateTime = New GridDateTimeColumn  
                                    colDateTime.ReadOnly = True 
                                    colDateTime.MaxLength = 10  
                                    colDateTime.DataType = System.Type.GetType("System.DateTime")  
                                    colDateTime.DataFormatString = "{0:dd/MM/yyyy}" 
                                    colDateTime.HeaderStyle.HorizontalAlign = HorizontalAlign.Center  
                                    colDateTime.UniqueName = CampoDb  
                                    colDateTime.HeaderText = TestoHeader  
                                    'ordine  
                                    colDateTime.OrderIndex = Ordine + 1  
                                    'dati  
                                    colDateTime.DataField = CampoDb  
                                    'ordinamento  
                                    colDateTime.SortExpression = CampoDb  
                                    'raggruppamento  
                                    colDateTime.Groupable = False 
                                    'filtro  
                                    If Filtro = 1 Then 
                                        colDateTime.AllowFiltering = True 
                                    Else 
                                        colDateTime.AllowFiltering = False 
                                    End If 
 
                                    'larghezza colonna  
                                    If Larghezza > 0 Then 
                                        colDateTime.HeaderStyle.Width = Unit.Pixel(Larghezza)  
                                        colDateTime.ItemStyle.Width = Unit.Pixel(Larghezza)  
                                        colDateTime.FilterControlWidth = Unit.Pixel(Larghezza - 15)  
                                    Else 
                                        colDateTime.HeaderStyle.Width = Unit.Pixel(DefaultColumnWidth)  
                                        colDateTime.ItemStyle.Width = Unit.Pixel(DefaultColumnWidth)  
                                        colDateTime.FilterControlWidth = Unit.Pixel(DefaultColumnWidth - 15)  
                                    End If 
 
                                    If (Visibile = 0) Then colDateTime.Visible = False 
 
                                    RadGridAnagrafiche.MasterTableView.Columns.Add(colDateTime)  
 
                                Else 
                                    colTemplate = New Telerik.Web.UI.GridTemplateColumn  
                                    colTemplate.ReadOnly = False 
                                    colTemplate.UniqueName = CampoDb  
                                    colTemplate.HeaderText = TestoHeader  
                                    colTemplate.OrderIndex = Ordine + 1  
                                    colTemplate.SortExpression = CampoDb  
                                    colTemplate.DataType = System.Type.GetType("System.DateTime")  
                                    colTemplate.HeaderStyle.HorizontalAlign = HorizontalAlign.Center  
                                    colTemplate.ItemStyle.HorizontalAlign = HorizontalAlign.Center  
 
                                    colTemplate.ItemTemplate = New ITemplateEditColumn(CampoDb, IType._Label, "dd/MM/yyyy")  
                                    colTemplate.EditItemTemplate = New ITemplateEditColumn(CampoDb, IType._RadDatePicker, "dd/MM/yyyy")  
 
                                    RadGridAnagrafiche.MasterTableView.Columns.Add(colTemplate)  
 
                                End If 
 
                            Case Else 'campo stringa  
                                If Editabile = 0 Then 
 
                                    colBound = New GridBoundColumn  
                                    colBound.UniqueName = CampoDb  
                                    colBound.HeaderText = TestoHeader  
                                    colBound.ReadOnly = True 
                                    colBound.OrderIndex = Ordine + 1  
                                    colBound.DataField = CampoDb  
                                    colBound.SortExpression = CampoDb  
                                    If Larghezza > 0 Then 
                                        colBound.HeaderStyle.Width = Unit.Pixel(Larghezza)  
                                        colBound.ItemStyle.Width = Unit.Pixel(Larghezza)  
                                    Else 
                                        colBound.HeaderStyle.Width = Unit.Pixel(DefaultColumnWidth)  
                                        colBound.ItemStyle.Width = Unit.Pixel(DefaultColumnWidth)  
                                    End If 
 
                                    If (Visibile = 0) Then colBound.Visible = False 
                                    RadGridAnagrafiche.MasterTableView.Columns.Add(colBound)  
 
                                Else 
                                    colTemplate = New Telerik.Web.UI.GridTemplateColumn  
                                    colTemplate.UniqueName = CampoDb  
                                    colTemplate.HeaderText = TestoHeader  
                                    colTemplate.ReadOnly = False 
                                    colTemplate.OrderIndex = Ordine + 1  
                                    colTemplate.DataField = CampoDb  
                                    colTemplate.SortExpression = CampoDb  
                                    colTemplate.HeaderStyle.HorizontalAlign = HorizontalAlign.Center  
                                    colTemplate.ItemStyle.HorizontalAlign = HorizontalAlign.Center  
 
                                    colTemplate.ItemTemplate = New ITemplateEditColumn(CampoDb, IType._Label)  
                                    colTemplate.EditItemTemplate = New ITemplateEditColumn(CampoDb, IType._TextBox)  
 
                                    RadGridAnagrafiche.MasterTableView.Columns.Add(colTemplate)  
                                End If 
 
                        End Select 
                    Next 
                End If 
 
 
 
            End If 
        End If 
 
        Try 
            RadGridAnagrafiche.MasterTableView.DataKeyNames = New String() {ChiaveGriglia}  
 
            ds.Tables.Add(MyUtil.getDataTable(CommandType.Text, SqlRecuperoDati, "Contenuto"))  
            RadGridAnagrafiche.DataSource = ds.Tables("Contenuto")  
        Catch ex As Exception  
 
        End Try 
 
    End Sub 
 
    Protected Sub RadGridAnagrafiche_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridAnagrafiche.UpdateCommand  
 
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)  
        Dim id As String = editedItem.GetDataKeyValue(ChiaveGriglia).ToString()  
 
        Dim returnValue As Hashtable = New Hashtable  
        e.Item.OwnerTableView.ExtractValuesFromItem(returnValue, editedItem)  
 
        Dim RigaOrdine As New Data.DataTable  
        Dim myRow As Integer = CType(e.Item.DataSetIndex, Double)  
 
        Dim CampoDb As String 
        Dim IsKey As Integer 
        Dim Editabile As Integer 
        Dim TipoDato As Integer 
 
        Dim EditControllo As String 
        Dim StrWhere As String 
 
        SqlUpdateDati = "UPDATE " + NomeTabella.ToString + " SET DATAMODIFICA=Getdate(), UTENTEMODIFICA=" 
 
        For i = 0 To dtAnaCol.Rows.Count - 1  
 
            CampoDb = dtAnaCol.Rows(i).Item("Campodb")  
            IsKey = dtAnaCol.Rows(i).Item("isKey")  
            Editabile = dtAnaCol.Rows(i).Item("Editable")  
            TipoDato = dtAnaCol.Rows(i).Item("TipoDato")  
 
            If IsKey = 1 Then 
                StrWhere = " WHERE " + CampoDb.ToString + "='" + id.ToString + "'" 
            Else 
 
                Select Case TipoDato  
 
                    Case 0 'campo string  
                        EditControllo = "MyTxt" + CampoDb.ToString  
                       
                        SqlUpdateDati += ", " + CampoDb.ToString + "='" + returnvalue + "' " 
 
                    Case 1 'campo data  
                        EditControllo = "MyRTP" + CampoDb.ToString  
 
 
                        SqlUpdateDati += ", " + CampoDb.ToString + "='" + returnvalue + "' " 
 
                End Select 
            End If 
        Next 
 
    End Sub 
 
End Class 
 in particular in this part of code we obtain the folowing error when evaluate this instruction:

e.Item.OwnerTableView.ExtractValuesFromItem(returnValue, editedItem)  

Editor cannot be initialized for column: {our_field_name}

- In the end this is class for definition of template fields:
Imports Microsoft.VisualBasic  
Imports Telerik.Web.UI  
Imports System.Data  
Imports System.Web.UI  
 
Public Class ITemplateEditColumn  
    Implements IBindableTemplate  
 
    Private colName As String 
    Private colFormat As String 
    Private colTipo As Integer 
 
    Protected rtp As RadDatePicker  
    Protected txt As TextBox  
    Protected lbl As Label  
 
 
    Public Enum IType As Integer 
        _TextBox = 0  
        _RadDatePicker = 1  
        _Label = 99  
    End Enum 
 
 
    Public Sub New(ByVal cName As StringByVal cTipo As IType, Optional ByVal cFormato As String = "")  
        colName = cName  
        colTipo = cTipo  
        colFormat = cFormato  
    End Sub 
 
    Public Function ExtractValues(ByVal container As Control) As System.Collections.Specialized.IOrderedDictionary Implements IBindableTemplate.ExtractValues  
        Dim od As OrderedDictionary = New OrderedDictionary  
        Select Case colTipo  
 
            Case 0 '_Txtbox  
                od.Add(colName, CType(container.FindControl("MyTxt" + colName), TextBox).Text)  
 
            Case 1 '_RadDatePicker  
                od.Add(colName, CType(container.FindControl("MyRTP" + colName), RadDatePicker).SelectedDate)  
 
        End Select 
        Return od  
    End Function 
 
    Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn  
        Select Case colTipo  
            Case 0 '_Txtbox  
                txt = New TextBox  
 
                txt.ID = "MyTxt" + colName.ToString  
 
                AddHandler txt.DataBinding, AddressOf TextBoxBinding  
                container.Controls.Add(txt)  
 
            Case 1 '_RadDatePicker  
                rtp = New RadDatePicker  
 
                rtp.ID = "MyRTP" + colName.ToString  
                rtp.EnableEmbeddedSkins = False 
                rtp.Skin = "3iSkin" 
                rtp.Width = Unit.Pixel(100)  
                rtp.DateInput.ID = "txtData" 
                rtp.DateInput.DateFormat = colFormat  
                rtp.DateInput.EnableEmbeddedSkins = False 
                rtp.DateInput.Skin = "3iSkin" 
 
                AddHandler rtp.DataBinding, AddressOf RadDatePickerBinding  
                container.Controls.Add(rtp)  
 
            Case 99 '_Label  
                Dim lbl As New Label  
 
                lbl.ID = "MyLbl" + colName.ToString  
 
                AddHandler lbl.DataBinding, AddressOf LabelBinding  
                container.Controls.Add(lbl)  
 
        End Select 
 
    End Sub 
 
    Private Sub LabelBinding(ByVal sender As ObjectByVal e As EventArgs)  
        Dim lbl As Label  
        lbl = CType(sender, Label)  
        Dim iContainer As Object 
        Dim drv As DataRowView  
 
        iContainer = lbl.NamingContainer  
        drv = iContainer.DataItem  
 
        If Not (IsDBNull(drv.Item(colName))) Then 
            If (colFormat.Length > 0) Then 
                lbl.Text = Format(drv.Item(colName), colFormat)  
            Else 
                lbl.Text = drv.Item(colName).ToString  
            End If 
        End If 
 
    End Sub 
 
    Private Sub TextBoxBinding(ByVal sender As ObjectByVal e As EventArgs)  
        Dim txt As TextBox  
        txt = CType(sender, TextBox)  
        Dim iContainer As Object 
        Dim drv As DataRowView  
 
        iContainer = txt.NamingContainer  
        drv = iContainer.DataItem  
 
        If Not (IsDBNull(drv.Item(colName))) Then 
            If (colFormat.Length > 0) Then 
                txt.Text = Format(drv.Item(colName), colFormat)  
            Else 
                txt.Text = drv.Item(colName).ToString  
            End If 
        End If 
 
    End Sub 
 
    Private Sub RadDatePickerBinding(ByVal sender As ObjectByVal e As EventArgs)  
        Dim rtp As RadDatePicker  
        rtp = CType(sender, RadDatePicker)  
        Dim iContainer As Object 
        Dim drv As DataRowView  
 
        iContainer = rtp.NamingContainer  
        drv = iContainer.DataItem  
 
        If Not (IsDBNull(drv.Item(colName))) Then 
            If (colFormat.Length > 0) Then 
                rtp.SelectedDate = Format(DateTime.Parse(drv.Item(colName)), colFormat)  
            Else 
                rtp.SelectedDate = drv.Item(colName).ToString  
            End If 
        End If 
 
    End Sub 
 
End Class 

I wait for a response.

Thank you

Gianluigi
Sebastian
Telerik team
 answered on 22 Jul 2009
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?