Telerik Forums
UI for ASP.NET AJAX Forum
15 answers
189 views
hi
  i used rad toolbar in my page for command buttons. The tool bar is top of each page and i set dir="rtl" so that my buttons are from right to left. Now i need to add one heading text in the toolbar from left side. buttons are right and my text is left. Anyway to achive this?
Akhil Raj
Top achievements
Rank 1
 answered on 23 Jun 2010
3 answers
191 views
Hi there,

Having an issue with the combo box; I have load on demand enabled and the values returning back have spaces between words...example, "Desktop Systems".

When I am typing in the combo box and come to the p in the text, I try and hit the space bar and I can't.  I'm stuck at the end of Desktop.  Is there a way around this or a setting I'm missing?

<telerik:RadComboBox ID="cboWebCategory"  
                                     runat="server" 
                                     OnSelectedIndexChanged="cboWebCategory_SelectedIndexChanged" 
                                     AutoPostBack="true" 
                                     DataTextField="WebCategory" 
                                     EnableTextSelection="true" 
                                     DataValueField="WebCategoryID" 
                                     MarkFirstMatch="true" 
                                     Height="150px" 
                                     Width="250px"
                </telerik:RadComboBox> 

Thank you,
Tad
Simon
Telerik team
 answered on 23 Jun 2010
1 answer
118 views
Hi,
Something I can't seem to find on the grid is something like the 'AutoGenerateAddColumn', I am using the grid's popup form to edit and I would have thought that the grid would be able to pop up it's own 'add' form aswell. Am I missing something or is it in fact necessary to manually code all aspects of the 'add' functionality, including the link for adding records? 
Princy
Top achievements
Rank 2
 answered on 23 Jun 2010
1 answer
146 views
Hi All,

I am porting an ASP.NET application, which uses many Telerik AJAX controls including RadUpload, to the Microsoft MVC platform.
In general, after sweating a bit RadUpload is configured and functions as expected with one minor exception:
The legacy code runs its own validation within an event handler upon a server-side ValidatingFile event. However, under MVC this event is never fired. From your blog published more than a year ago I learnt why the old mechanism would not work; also that blog promised in future "a full-blown ASP.NET MVC application built on top of RadControls for ASP.NET Ajax".

So my questions are:
  • Does such application exist nowadays and is the server-side validation issue resolved in it? By the server-side validation I refer to validation that would be executed before the corresponding View is destroyed and execution flow is back within the Controller.
  • If I executed client-side validation in javascript, would such javascript code be able to validate the size of a selected file?
  • If the integrated validation used, would be there a way to provide custom error messages on validation failure?

Thank you in advance for your assistance.

-- Best regards
Genady Sergeev
Telerik team
 answered on 23 Jun 2010
3 answers
127 views
Hi There

I am using a radcombobox box as below:-
 <telerik:RadComboBox ID="radComboFullname" AllowCustomText="true" runat="server" AutoPostBack="true" SkinID="fullnamesearchdropdown" 
                        CausesValidation="False" OnClientItemsRequesting="RequestingHandler" EnableLoadOnDemand="true" 
                        HighlightTemplatedItems="true" ItemRequestTimeout="750" DataSourceID="objDSClientSmartSearch" 
                        DataTextField="fullname" DataValueField="id" TabIndex="1" OnItemsRequested="radComboFullname_ItemsRequested" 
                        OnSelectedIndexChanged="radComboFullname_SelectedIndexChanged"   
                        ShowMoreResultsBox="true" MaxLength="100" IsCaseSensitive="false" LoadingMessage="Searching. Please Wait..." > 
                    </telerik:RadComboBox> 

When the user types more than 2 characters we go off and try to bring back results to display and that works just fine - when niothing is found however we see the text No Matches which is great, but what I need to have happen is for focus to leave this rad combobox from the code behind within :-
protected void radComboFullname_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
    if (e.Text.Trim().Length >= 2)
    {
    }
    else
    {
        //move focus off the control
    }
}            

How can i accomplish this?


The javascript we use is also as follows:-
function RequestingHandler(sender, eventArgs) {
            //restrict ajax request until after 2 chars
            if (eventArgs.get_text().length < 2)
                eventArgs.set_cancel(true)
            else
                eventArgs.set_cancel(false);
        }
Simon
Telerik team
 answered on 23 Jun 2010
1 answer
71 views
I Need to add an image or line in order to separate between 1st and last image in the rotator.
How can i do that?
Fiko
Telerik team
 answered on 23 Jun 2010
1 answer
172 views
A couple feature requests I would like to see.

FileExplorer to be able to work with UNC urls.

To be able to box/unbox FileItems and DirectoryItems from FileInfo and DirectoryInfo objects.
Fiko
Telerik team
 answered on 23 Jun 2010
1 answer
448 views
I am having problems with setting the selected value of a RadCombobox that loads items on demand.

I have a RadComboBox as a templated item within a RadGrid and the page I have is geared towards batch updates in a Radgrid and based on this example: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx, except for some very important differences in the type of drop down used which may be contributing to the issues.

Unlike the example, I use a RadCombobox that loads items on demand instead of a regular dropdown and I want to bind the RadCombobox to a nullable item.  I am unable to bind the SelectedValue property of the RadComboBox to the value I want, AccountID, using a simple Bind("AccountID") statement because the value can (and often is) null (which is valid in my scenario).

When I double click a row to put it in "edit mode", e.g. display the Radcombobox and hide the Label, no items are loaded into the combobox until I click on it (due to the load on demand).  I have been unable to get the RadCombobox to have it's selected value initially set to a SelectedValue because of this and I wondering what I am doing wrong/missing.

I can tell that cb.SelectedValue is being set to the correct value in the RadGrid's ItemDatabound event, but at that time there are 0 items loaded into a RadCombobox for a particular row.  I have also tried commenting out ClearSelection in the item load in the RadCombobox's ItemsRequested method, but that has no effect.

One thing I thought is that, since lblAccountID also contains the value I would want to bind/select in the RadCombobox there could be a JavaScript solution to this, where after the items are loaded on demand, the corresponding lblAccountID label for the particular row could be checked and used to set the selected value in the cboAccountID in a delayed manner.


            <telerik:GridTemplateColumn UniqueName="AccountID" SortExpression="AccountID" HeaderText="Account" ConvertEmptyStringToNull="true"
                    <ItemTemplate> 
                             <asp:Label ID="lblAccountID" runat="server" Text='<%# Eval("AccountID") %>' Width="305px" /> 
            <telerik:radcombobox id="cboAccountID" runat="server"   
                        Width="305px" Height="200px"  
                        EnableVirtualScrolling="true"  
                        HighlightTemplatedItems="true" 
                        EnableLoadOnDemand="true" 
                        DataValueField="AccountID" 
                        OnItemsRequested="cboAccountID_ItemsRequested"  
                        Style="display: none" 
                        EmptyMessage="Select a Account" > 
                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                        <HeaderTemplate> 
                                    <table style="width: 275px" cellspacing="0" cellpadding="0"
                                        <tr> 
                                            <td style="width: 20%;"
                                                AccountID</td> 
                                            <td style="width: 80%"
                                                Account Alias and ControlSrc</td> 
                                            <td style="width: 20%"
                                                Is Active?</td> 
                                        </tr> 
                                    </table> 
                                </HeaderTemplate> 
                                <ItemTemplate> 
                                    <table style="width: 275px" cellspacing="0" cellpadding="0"
                                        <tr> 
                                            <td style="width: 20%;"
                                                <%#DataBinder.Eval(Container, "Attributes['AccountID']")%> 
                                            </td> 
                                            <td style="width: 80%;"
                                                <%#DataBinder.Eval(Container, "Attributes['AccountAliasAndControlSrc']")%> 
                                            </td> 
                                            <td style="width: 20%;"
                                                <%# DataBinder.Eval(Container, "Attributes['IsActive']")%> 
                                            </td> 
                                        </tr> 
                                    </table> 
                                </ItemTemplate> 
                        </telerik:radcombobox> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                 

Code-behind:
   Protected Sub RadGrid1_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound 
 
        Dim cbo As RadComboBox = e.Item.FindControl("cboAccountID"
        If Not cbo Is Nothing Then 
            If Not DataBinder.Eval(e.Item.DataItem, "AccountID"Is Nothing And IsDBNull(DataBinder.Eval(e.Item.DataItem, "AccountID")) = False Then 
                Try 
                    cbo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "AccountID").ToString 
                Catch ex As ArgumentOutOfRangeException 
 
                Catch ex As Exception 
 
                End Try 
  
            End If 
        End If 
 
        Dim lbl As Label = e.Item.FindControl("lblAccountID"
        If Not lbl Is Nothing Then 
            If Not DataBinder.Eval(e.Item.DataItem, "AccountID"Is Nothing And IsDBNull(DataBinder.Eval(e.Item.DataItem, "AccountID")) = False Then 
                If Not String.IsNullOrEmpty(lbl.Text) Then 
                    Me.ToolTipManager.TargetControls.Add(lbl.ClientID, DataBinder.Eval(e.Item.DataItem, "AccountID").ToString, True
                End If 
            End If 
        End If 
    End Sub 

Protected Sub cboAccountID_ItemsRequested(ByVal sender As ObjectByVal e As RadComboBoxItemsRequestedEventArgs) 
        Dim reader As SqlDataReader = SqlHelper.ExecuteReader(ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString, _ 
                        Data.CommandType.StoredProcedure, "proc_ConfigAccounts_GetAllAccounts"
 
        Dim comboBox As RadComboBox = DirectCast(sender, RadComboBox) 
        comboBox.Items.Clear() 
        comboBox.ClearSelection() 
        While reader.Read 
            Dim item As New RadComboBoxItem() 
 
            item.Text = reader("AccountID").ToString & " | " & reader("AccountAliasAndControlSrc") & " | " & reader("IsActive").ToString 
            item.Value = reader("AccountID"
 
            Dim AccountAliasAndControlSrc As String = reader("AccountAliasAndControlSrc"
            Dim isActive As Boolean = reader("IsActive"
 
            item.Attributes.Add("AccountID", reader("AccountID").ToString) 
 
            item.Attributes.Add("AccountAliasAndControlSrc", AccountAliasAndControlSrc.ToString()) 
            item.Attributes.Add("IsActive", isActive.ToString()) 
 
            comboBox.Items.Add(item) 
            item.DataBind() 
        End While 
        reader.Close() 
 
 
        ' ''Add default list item 
        ''Dim DefaultItem As New RadComboBoxItem() 
        ''DefaultItem.Text = TryCast(GetGlobalResourceObject("CommonTerms", "EmptyDropdownItem"), String) 
        ''DefaultItem.Value = String.Empty 
        ''comboBox.Items.Insert(0, DefaultItem) 
    End Sub 

Simon
Telerik team
 answered on 23 Jun 2010
1 answer
138 views
I use Radgrid which contain template columns. In template column i use item Template With ASP:Imagebutton & ASP:label.
When i click on first image button then RadGrid_Itemcommand Is fired. After that i click on second image button is also fine. But after that when i again click on first image button then item_Command not fired.
Please give me solution it's very urgent. Thanks in advance.
I Post my code.
ProductCatalog.aspx

<%

@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ProductCatalog.aspx.vb" Inherits="ProductCatalog" EnableViewStateMac="false" %>

 

 <%

@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

 <%

@ Register Src="ProductDetails(vb).ascx" TagName="ProductDetails" TagPrefix="uc1" %>

 

 

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

 

 

<html xmlns="http://www.w3.org/1999/xhtml">

 

     

<head></head>

 

     

<body>

 

         

<asp:UpdatePanel ID="updatepanel2" runat="server" UpdateMode="Conditional" >

 

 

            <ContentTemplate>

 

 

            <script type="text/javascript">

 

 

             

 function CloseActiveToolTip() {

 

 

            setTimeout(

 

            function() {

 

            var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();

 

 

             

if (tooltip) tooltip.hide();

 

 

             }, 1000);

        }

         

</script>

 

 

 

 

 

<telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Position= "Center" BorderWidth="1px" RelativeTo= "Element" Width="500px" Height="300px" HideEvent="FromCode" Skin="WebBlue" ShowEvent="OnClick" VisibleOnPageLoad="true" Modal="true" OnAjaxUpdate="OnAjaxUpdate" BackColor="#EEEEEE" Animation= "Fade" >

 

 

</telerik:RadToolTipManager>

 

 

<telerik:RadSplitter ID="RadSplitter1" Runat="server" Width="1015px" Height="886px" BackColor="Black" Skin="WebBlue" >

 

 

<telerik:RadPane id="Radpane1" runat="server" width="22px" Collapsed="false" scrolling="None" minwidth="22" CssClass="Radpane" BackColor="#EEEEEE" Height="16px"><telerik:RadSlidingZone ID="SlidingZone1" runat="server" BackColor="#EEEEEE" clicktoopen="true" Visible="true" width="22" DockedPaneId="Contacts" >

 

 

<telerik:RadSlidingPane ID="Contacts" runat="server" Visible="true" width="190px" Height="400px" >

 

 

<telerik:RadTreeView ID="RadTreeView1" runat="server" BackColor="Black" Font-Names="Tahoma" Font-Size="13px" Skin="Hay" Height="900px" Width="175px" ForeColor="White"></telerik:RadTreeView></telerik:RadSlidingPane></telerik:RadSlidingZone></telerik:RadPane>

 

 

<telerik:RadSplitBar id="RadSplitbar1" runat="server" CollapseMode="Forward" BackColor="#EEEEEE"></telerik:RadSplitBar>

 

 

<telerik:RadPane id="RadPane2" runat="server" scrolling="y" style="z-index: 1; left: 1px; top: 329px; position: absolute; height: 653px; width: 856px"><table cellpadding="0" cellspacing="0" ><tr><td>

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" BackColor="Black" Font-Names="Verdana" Font-Size="Medium" ForeColor="#800040" GridLines="None" Height="624px" Skin="Black" style="margin-bottom: 0px; margin-top: 0px;" Visible="False" Width="990px" OnItemCommand="radgrid1_itemcommand" >

 

 

<headercontextmenu enabletheming="true"><collapseanimation duration="200" type="OutQuint" />

 

 

</headercontextmenu><mastertableview DataKeyNames="srno"><rowindicatorcolumn><HeaderStyle Width="20px" /></rowindicatorcolumn>

 

 

<expandcollapsecolumn><HeaderStyle Width="20px" /></expandcollapsecolumn>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="10px" HeaderText="" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px" UniqueName="TemplateColumn" >

 

 

<ItemTemplate>

 

 

<asp:ImageButton ID="Image1" Runat="server" CommandName="Image1" Height="130px" ImageAlign="Middle" ImageUrl='<%#""& Container.DataItem("imag1")&"" %>' Width="140px" AlternateText='<%#""& Container.DataItem("style1")&"" %>' />

 

 

<asp:Label ID="label1" runat="server" Font-Names="Tahoma" Font-Size="13px" ForeColor="White" Width="140px" Text='<%#""& Container.DataItem("style1")&"" %>' />

 

 

</ItemTemplate>

 

 

    <HeaderStyle Width="10px" /><ItemStyle Width="100px" />

 

 

    </telerik:GridTemplateColumn>

 

 

    <telerik:GridTemplateColumn HeaderStyle-Width="10px" HeaderText="" ItemStyle-Width="100px"     UniqueName="TemplateColumn"     ItemStyle-HorizontalAlign="Center" >

 

 

<ItemTemplate>

 

 

<asp:ImageButton ID="Image2" Runat="server" AlternateText='<%#""& Container.DataItem("style2")&"" %>' BorderColor="#eeeeee" BorderWidth="0px" CommandName="Image2" Height="130px" ImageAlign="Middle" ImageUrl='<%#""& Container.DataItem("imag2")&"" %>' Width="140px" />

 

 

<asp:Label ID="label2" runat="server" ForeColor="White" Font-Names="Tahoma" Font-Size="13px" Width="140px" Text='<%#""& Container.DataItem("style2")&"" %>' />

 

 

</ItemTemplate><HeaderStyle Width="10px" /><ItemStyle Width="100px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderStyle-Font-Bold="true" HeaderStyle-ForeColor="Aqua" HeaderStyle-Font-Names="Tahoma" HeaderStyle-Font-Size="15px" HeaderText="Product Catalog" ItemStyle-Width="100Px" UniqueName="TemplateColumn" ItemStyle-HorizontalAlign="Center">

 

 

<ItemTemplate>

 

 

<asp:ImageButton ID="Image3" Runat="server" AlternateText='<%#""& Container.DataItem("style3")&"" %>' BorderColor="#eeeeee" BorderWidth="0px" CommandName="Image3" Height="130px" ImageAlign="Middle" ImageUrl='<%#""& Container.DataItem("imag3")&"" %>' Width="140px" />

 

 

<asp:Label ID="label3" runat="server" ForeColor="White" Font-Names="Tahoma" Font-Size="13px" Width="140px" Text='<%#""& Container.DataItem("style3")&"" %>' />

 

 

</ItemTemplate><HeaderStyle Font-Bold="True" /><ItemStyle Width="100px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="" ItemStyle-Width="100Px" UniqueName="TemplateColumn" ItemStyle-HorizontalAlign="Center">

 

 

<ItemTemplate>

 

 

<asp:ImageButton ID="Image4" Runat="server" AlternateText='<%#""& Container.DataItem("style4")&"" %>' BorderColor="#eeeeee" BorderWidth="0px" CommandName="Image4" Height="130px" ImageAlign="Middle" ImageUrl='<%#""& Container.DataItem("imag4")&"" %>' Width="140px" />

 

 

<asp:Label ID="label4" runat="server" ForeColor="White" Font-Names="Tahoma" Font-Size="13px" Width="140px" Text='<%#""& Container.DataItem("style4")&"" %>' />

 

 

</ItemTemplate><ItemStyle Width="100px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="" ItemStyle-Width="100Px" UniqueName="TemplateColumn" ItemStyle-HorizontalAlign="Center">

 

 

<ItemTemplate>

 

 

<asp:ImageButton ID="Image5" Runat="server" AlternateText='<%#""& Container.DataItem("style5")&"" %>' BorderColor="#eeeeee" BorderWidth="0px" CommandName="Image5" Height="130px" ImageAlign="Middle" ImageUrl='<%#""& Container.DataItem("imag5")&"" %>' Width="140px" />

 

 

<asp:Label ID="label5" runat="server" ForeColor="White" Font-Names="Tahoma" Font-Size="13px" Width="140px" Text='<%#""& Container.DataItem("style5")&"" %>' />

 

 

</ItemTemplate><ItemStyle Width="100px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="" ItemStyle-Width="100Px" UniqueName="TemplateColumn" ItemStyle-HorizontalAlign="Center">

 

 

<ItemTemplate>

 

 

<asp:ImageButton ID="Image6" Runat="server" AlternateText='<%#""& Container.DataItem("style6")&"" %>' BorderColor="#eeeeee" BorderWidth="0px" CommandName="Image5" Height="130px" ImageAlign="Middle" ImageUrl='<%#""& Container.DataItem("imag6")&"" %>' Width="140px" />

 

 

<asp:Label ID="label6" runat="server" ForeColor="White" Font-Names="Tahoma" Font-Size="13px" Width="140px" Text='<%#""& Container.DataItem("style6")&"" %>' />

 

 

</ItemTemplate><ItemStyle Width="100px" />

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</mastertableview>

 

 

<clientsettings enablepostbackonrowclick="true">

 

 

<selecting allowrowselect="true" />

 

 

</clientsettings><HeaderStyle Height="1px" />

 

 

<filtermenu enabletheming="True"><collapseanimation duration="200" type="OutQuint" /></filtermenu>

 

 

</telerik:RadGrid></td></tr></tr></table></telerik:RadPane>

 

 

</telerik:RadSplitter>

 

 

</div>

 

 

</ContentTemplate>

 

 

</asp:UpdatePanel>

 

 <

asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2" >

 

 

<ProgressTemplate>

 

 

<div id="OuterTableCellOverlay">

 

 

<div id="InnerTableCellOverlay" style="color:Blue" ><B>... LOADING PLEASE WAIT...</B>&nbsp;<BR />

 

 

<asp:Image id="LoadImage1" runat="server" ImageUrl="~/Images/ajax-loader.gif"></asp:Image>

 

 

</div>

 

 

</div>

 

 

</ProgressTemplate>

 

 

</asp:UpdateProgress>

 

 </

 

body>

 

 </

 

html>

 

 

</asp:Content>

 

 

 


ProductCatalog.aspx.vb

 

 

 Imports

 

System.Data

 

 

Imports System.Data.SqlClient

 

 

Imports System.Data.Sql

 

 

Imports System.Web.UI

 

 

 Imports Telerik.Web.UI

 

 

 Imports ASP

 

 

 Imports cls1

 

 

 Imports Microsoft.Vbe.Interop

 

 

 Imports Telerik.Web

 

 

Imports  System

 

 

 Imports System.Configuration

 

 

Imports System.Collections

 

 

Imports System.Web

 

 

Imports System.Web.Security

 

 

Imports  System.Web.UI.WebControls

 

 

Imports System.Web.UI.WebControls.WebParts

 

 

Imports System.Web.UI.HtmlControls

 

 

 

 

Partial

 

Class ProductCatalog

 

 

Inherits System.Web.UI.Page

 

 

 

Dim db As clsDBLayer

 

 

Dim temp As Telerik.Web.UI.RadTreeNode

 

Dim temp1 As Telerik.Web.UI.RadTreeNode

 

Dim newvalue As String

 

Dim dsfillgrid As New DataSet

 

Dim getgroupid As Integer

 

Dim dt As DataTable

 

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

'If userid=null then goto login page

 

If Session("Userid") = "" Then

 

Response.Redirect("Login.aspx", False)

 

 

End If

 

 

filltreeview()
End Sub

 

 

 

 

 

'this function used to fill the grid with style

 

 

 

 

Protected Sub RadTreeView1_NodeClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTreeView1.NodeClick

 

 

 

Dim str1 As String

 

 

Try

 

 

' if the clicked node is last child Node then checked

 

 

 

 

If e.Node.Nodes.Count = 0 Then

 

 

RadGrid1.Visible =

True

 

 

str1 = RadTreeView1.SelectedValue

 

Session(

"LastGroup") = RadTreeView1.SelectedValue

 

 getgroupid = CommonFunction.UDGetSingleValue(

"select groupid from groupmaster where name='" & str1 & "'", True,clsStartUp.Conjewel)

 

 

db = New clsDBLayer

 

 dsfillgrid = db.GetDataset(

"SET QUOTED_IDENTIFIER OFF ; Exec PROC_Teststylegridmatrix " & getgroupid & " SET QUOTED_IDENTIFIER on", "Grid")

 

 

Session(

"Fillgrid") = dsfillgrid

 

 RadGrid1.DataSource = dsfillgrid.Tables(

"Grid")

 

 RadGrid1.DataBind()

 

Me.RadToolTipManager1.Visible = False

 

 

Else

 

 

RadGrid1.Columns.Clear()

 

RadGrid1.Controls.Clear()

RadGrid1.Visible =

False

 

 

End If

 

 

 

 

 

Catch ex As Exception

 

 

End Try

 

 

 

 

End Sub

 

 

 

'This function used to display the tooltip when we click on image(Style)

 

 

 

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand

 

 

Dim ColNo As String = Right(e.CommandName, 1)

 

 

Dim image As Control = e.Item.FindControl("Image" & ColNo)

 

 

Dim currentRow As ImageButton = DirectCast(e.CommandSource, ImageButton)

 

 

Try

 

 

'When clicked on image show tooltip with selected item

 

 

Me.RadToolTipManager1.Visible = True

 

 

 

clsStartUp.GridEdit =

False

 

 

 

clsStartUp.vieworder =

False '21nov

 

 

clsStartUp.submitorder = False '21nov

 

 

clsStartUp.imagepath = currentRow.ImageUrl

 

Session(

"imagename") = currentRow.AlternateText

 

 

 

If LTrim(Session("imagename")) <> "" Then

 

 

Session("styleid") = CommonFunction.UDGetSingleValue("select styleid from stylemaster where name='" & Session("imagename") & "'", True, clsStartUp.Conjewel)

 

 

Me.RadToolTipManager1.TargetControls.Add(image.ClientID, currentRow.ID, True)

 

 

 

Dim ctrl As Control = Page.LoadControl("ProductDetails(vb).ascx")

 

 

End If

 

 

If LTrim(Session("imagename")) = "" Then

 

 

Me.RadToolTipManager1.Visible = False

 

 

End If

 

 

Catch ex As Exception

 

 

 

 

End Try

 

 

End Sub

 

 

 

 

Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs)

 

Me.UpdateToolTip(args.Value, args.UpdatePanel)

 

 

End Sub

 

 

 

 

Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)

 

Dim ctrl As Control = Page.LoadControl("ProductDetails(vb).ascx")

 

panel.ContentTemplateContainer.Controls.Add(ctrl)

 

End Sub

 

 

 

End

 

Class

 

 

 

Veli
Telerik team
 answered on 23 Jun 2010
1 answer
239 views

We use scheduler control .

To the  appointment we use  advanced form user control  that contain resources  user control.

The advanced form code here:

 

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AdvancedFormCS.ascx.cs" 
    Inherits="SchedulerTemplatesCS.AdvancedForm" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<%@ Register TagPrefix="scheduler" TagName="ResourceControl" Src="ResourceControlCS.ascx" %> 
<div class="rsAdvancedEdit" style="position: relative; top: -15px; left: -10px;">  
    <div class="rsAdvTitle">  
        <h1 class="rsAdvInnerTitle">  
            עריכת פגישה</h1> 
        <asp:LinkButton runat="server" ID="AdvancedEditCloseButton" CssClass="rsAdvEditClose" 
            CommandName="Cancel" CausesValidation="false" ToolTip='<%# Owner.Localization.AdvancedClose %>'>  
            <%= Owner.Localization.AdvancedClose %> 
        </asp:LinkButton> 
    </div> 
    <div class="rsAdvContentWrapper">  
        <div class="rsAdvOptionsScroll">  
            <asp:Panel runat="server" ID="BasicControlsPanel" CssClass="rsAdvBasicControls">  
                <table> 
                    <tr> 
                        <td> 
                            <label for="<%= StartDate.ClientID %>_dateInput_text">  
                                זמן התחלה</label> 
                            <telerik:RadDatePicker ID="StartDate" runat="server" CssClass="rsAdvDatePicker" Culture="<%# Owner.Culture %>" 
                                MinDate="1900-01-01" SharedCalendarID="SharedCalendar" Skin="<%# Owner.Skin %>" 
                                Width="83px">  
                                <DatePopupButton Visible="False" /> 
                                <DateInput ID="DateInput2" runat="server" DateFormat="<%# Owner.AdvancedForm.DateFormat %>" 
                                    EmptyMessage=" " EmptyMessageStyle-CssClass="radInvalidCss_Default" /> 
                            </telerik:RadDatePicker> 
                            <telerik:RadTimePicker ID="StartTime" runat="server" CssClass="rsAdvTimePicker" Culture="<%# Owner.Culture %>" 
                                Skin="<%# Owner.Skin %>" Width="65px">  
                                <DateInput ID="DateInput3" runat="server" EmptyMessage=" " EmptyMessageStyle-CssClass="radInvalidCss_Default" /> 
                                <TimePopupButton Visible="false" /> 
                                <TimeView ID="TimeView1" runat="server" Columns="2" EndTime="18:00" Interval="00:30" 
                                    ShowHeader="false" StartTime="08:00" /> 
                            </telerik:RadTimePicker> 
                        </td> 
                        <td> 
                            <label for="<%= EndDate.ClientID %>_dateInput_text">  
                                זמן סיום</label> 
                            <telerik:RadDatePicker ID="EndDate" runat="server" CssClass="rsAdvDatePicker" Culture="<%# Owner.Culture %>" 
                                MinDate="1900-01-01" SharedCalendarID="SharedCalendar" Skin="<%# Owner.Skin %>" 
                                Width="83px">  
                                <DatePopupButton Visible="False" /> 
                                <DateInput ID="DateInput4" runat="server" DateFormat="<%# Owner.AdvancedForm.DateFormat %>" 
                                    EmptyMessage=" " EmptyMessageStyle-CssClass="radInvalidCss_Default" /> 
                            </telerik:RadDatePicker> 
                            <telerik:RadTimePicker ID="EndTime" runat="server" CssClass="rsAdvTimePicker" Culture="<%# Owner.Culture %>" 
                                Skin="<%# Owner.Skin %>" Width="65px">  
                                <DateInput ID="DateInput5" runat="server" EmptyMessage=" " EmptyMessageStyle-CssClass="radInvalidCss_Default" /> 
                                <TimePopupButton Visible="false" /> 
                                <TimeView ID="TimeView2" runat="server" Columns="2" EndTime="18:00" Interval="00:30" 
                                    ShowHeader="false" StartTime="08:00" /> 
                            </telerik:RadTimePicker> 
                        </td> 
                    </tr> 
                    <asp:CheckBox runat="server" ID="AllDayEvent" CssClass="rsAdvChkWrap" Checked="false" 
                        Text="כל היום" Visible="false" /> 
                    <asp:RequiredFieldValidator ID="StartDateValidator" runat="server" ControlToValidate="StartDate" 
                        CssClass="rsValidatorMsg" Display="None" EnableClientScript="true" /> 
                    <asp:RequiredFieldValidator ID="StartTimeValidator" runat="server" ControlToValidate="StartTime" 
                        CssClass="rsValidatorMsg" Display="None" EnableClientScript="true" /> 
                    <asp:RequiredFieldValidator ID="EndDateValidator" runat="server" ControlToValidate="EndDate" 
                        CssClass="rsValidatorMsg" Display="None" EnableClientScript="true" /> 
                    <asp:RequiredFieldValidator ID="EndTimeValidator" runat="server" ControlToValidate="EndTime" 
                        CssClass="rsValidatorMsg" Display="None" EnableClientScript="true" /> 
                    <asp:CustomValidator ID="DurationValidator" runat="server" ControlToValidate="StartDate" 
                        CssClass="rsValidatorMsg rsInvalid" Display="Dynamic" EnableClientScript="false" 
                        OnServerValidate="DurationValidator_OnServerValidate" /> 
                    <%-- RESOURCE CONTROLS --%> 
                    <tr> 
                        <td> 
                           <scheduler:ResourceControl ID="ResInspector" runat="server" Label="פקח:" Skin="<%# Owner.Skin %>" 
                                Type="Inspector" /> 
                             
                        </td> 
                        <td> 
                           <scheduler:ResourceControl ID="ResTest" runat="server" Label="סוג בדיקה:" Skin="<%# Owner.Skin %>" 
                                Type="Test" /> 
                            
                        </td> 
                    </tr> 
                    <tr> 
                        <td> 
                             
                        </td> 
                        <td> 
                            
                          <scheduler:ResourceControl ID="ResSite" runat="server" Label="אתר:" Skin="<%# Owner.Skin %>" 
                                Type="Site" /> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td> 
                            <scheduler:ResourceControl ID="ResStatus" runat="server" Label="סטאטוס:" Skin="<%# Owner.Skin %>" 
                                Type="Status" /> 
                       
                        </td> 
                    </tr> 
                    <tr> 
                        <td colspan="2">  
                            <telerik:RadTextBox ID="DescriptionText" runat="server" Label="הערה:" TextMode="MultiLine" 
                                Rows="5" Width="100%" Text='<%# Eval("Description") %>' /> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td> 
                            <asp:HiddenField ID="OriginalRecurrenceRule" runat="server" /> 
                            <telerik:RadCalendar ID="SharedCalendar" runat="server" CultureInfo="<%# Owner.Culture %>" 
                                RangeMinDate="1900-01-01" ShowRowHeaders="false" Skin="<%# Owner.Skin %>" /> 
                        </td> 
                    </tr> 
                </table> 
            </asp:Panel> 
        </div> 
        <asp:Panel runat="server" ID="ButtonsPanel" CssClass="rsAdvancedSubmitArea">  
            <div class="rsAdvButtonWrapper">  
                <asp:LinkButton runat="server" ID="UpdateButton" CssClass="rsAdvEditSave""> 
                    <span>שמור</span> 
                </asp:LinkButton> 
                <asp:LinkButton runat="server" ID="CancelButton" CssClass="rsAdvEditCancel" CommandName="Cancel" 
                    CausesValidation="false">  
                    <span>בטל</span> 
                </asp:LinkButton> 
            </div> 
        </asp:Panel> 
    </div> 
</div> 
 

The  resources   code here:



<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ResourceControlCS.ascx.cs" 
    Inherits="SchedulerTemplatesCS.ResourceControl" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<asp:Label runat="server" ID="ResourceLabel" AssociatedControlID="ResourceValue" 
    Text='<%# Label %>' CssClass="rsAdvResourceLabel" /> 
<telerik:RadComboBox runat="server" ID="ResourceValue" CssClass="rsAdvResourceValue" 
    Skin='<%# Skin %>' /> 
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="ResourceValue" 
    ErrorMessage="שדה חובה" runat="server" SetFocusOnError="true" Display="Dynamic" > 
</asp:RequiredFieldValidator> 
 

to the resources   user control controls, when I in the advanced form  on client side

I want to do :

·         Events

·          Default  values

·         Validations

How can I do that ?

Dimitar Milushev
Telerik team
 answered on 23 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?