Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
245 views
Hi.  I am looking for code sample (VB.NET) to do something in the webpage when the user selects a row in the gridcontrol in a user control.  The user control code is listed below. 

<%

@ Control Language="VB" AutoEventWireup="false" CodeFile="YALReadOnlyGrid.ascx.vb" Inherits="UserControls_YALReadOnlyGrid" %>

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

 
<telerik:RadGrid ID="RadROGrid" runat="server"   
     AllowPaging="true" AllowSorting="True" GridLines="None" Skin="Sunset"   
    Width="275px">  
        <MasterTableView> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
        </MasterTableView> 
          
            
        <ClientSettings> 
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
</telerik:RadGrid> 


In the webpage, the user control is accessed as follows

<%@ Page Title="" Language="VB" MasterPageFile="~/Common/YALMasterPage.master" AutoEventWireup="false" CodeFile="YALDropDowns.aspx.vb" Inherits="Admin_YALDropDowns" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderHeader" Runat="Server">  
</asp:Content> 
<asp:Content ID="Content3" ContentPlaceHolderID="ConPHLeftTop" Runat="Server">  
    <YAL:YALROGenGrid runat="server" ID="YALDDVals" Source="DropDowns" setPageSize="50" /> 
</asp:Content> 
<asp:Content ID="Content4" ContentPlaceHolderID="ConPHLeftBottom" Runat="Server">  
</asp:Content> 
<asp:Content ID="Content5" ContentPlaceHolderID="ConPHRightTop" Runat="Server">  
</asp:Content> 


Thanks for any help and/or sample code that you can provide
John
Top achievements
Rank 1
 answered on 15 Jun 2010
2 answers
285 views
Hi,

I getting strange error on row edit.
1. I implemented inline row edit on double click. But the row is editing in "Form Template Edit Form". I want only inline line edit. How do it. I am doing something but  I am unable to get it. Can anyone help me.

here is java script.

function RowDblClick(sender, eventArgs) { 
            editedRow = eventArgs.get_itemIndexHierarchical(); 
            $find("<%= gvCktMap.MasterTableView.ClientID %>").editItem(editedRow); 
        } 
 
        function GridCommand(sender, args) { 
            if (args.get_commandName() != "Edit") { 
                editedRow = null
            } 
        } 
 
        function GridCreated(sender, eventArgs) { 
            var gridElement = sender.get_element(); 
            var elementsToUse = []; 
            inputs = gridElement.getElementsByTagName("input"); 
            for (var i = 0; i < inputs.length; i++) { 
                var lowerType = inputs[i].type.toLowerCase(); 
                if (lowerType == "hidden" || lowerType == "button") { 
                    continue; 
                } 
 
                Array.add(elementsToUse, inputs[i]); 
                inputs[i].onchange = TrackChanges
            } 
 
            dropdowns = gridElement.getElementsByTagName("select"); 
            for (var i = 0; i < dropdowns.length; i++) { 
                dropdowns[i].onchange = TrackChanges
            } 
 
            setTimeout(function() { if (elementsToUse[0]) elementsToUse[0].focus(); }, 100); 
        } 
 
 
 

Radgrid

<telerik:RadGrid ID="gvCktMap" BorderColor="White" runat="server" AutoGenerateColumns="true" 
                                AllowSorting="true" BackColor="White" AllowPaging="true" PageSize="25" GridLines="None" 
                                OnPageIndexChanging="gvCktMap_PageIndexChanging" OnRowCancelingEdit="gvCktMap_RowCancelingEdit" 
                                OnRowCommand="gvCktMap_RowCommand" OnRowUpdating="gvCktMap_RowUpdating" OnRowDataBound="gvCktMap_RowDataBound" 
                                OnSorting="gvCktMap_Sorting" OnRowEditing="gvCktMap_RowEditing" ShowGroupPanel="True" 
                                EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" AllowMultiRowSelection="true" 
                                AllowFilteringByColumn="True" AllowCustomPaging="false" OnItemCreated="gvCktMap_ItemCreated" 
                                EnableViewState="false" OnNeedDataSource="gvCktMap_NeedDataSource" OnItemUpdated="gvCktMap_ItemUpdated"
                                <MasterTableView DataKeyNames="sId"
                                </MasterTableView> 
                                     
                                 
                                <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True"
                                    <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" 
                                        OnCommand="GridCommand" /> 
                                    <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                                    <Selecting AllowRowSelect="True"></Selecting> 
                                    <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True" 
                                        ResizeGridOnColumnResize="False"></Resizing> 
                                </ClientSettings> 
                                <GroupingSettings ShowUnGroupButton="true" /> 
                                <PagerStyle Mode="NextPrevAndNumeric" HorizontalAlign="Right" Font-Bold="true" AlwaysVisible="true" /> 
                            </telerik:RadGrid> 

2. I want to give few columns to edit. For ex. i have columns a, b, c, d, e, f, g.  When user double click on a row the user should get e, f, g columns to edit.
Babu Puchakayala
Top achievements
Rank 1
 answered on 15 Jun 2010
1 answer
119 views
Hi,

Can I select more than 1 values using checkboxes in Rad Combobox?

Regards,
Lubna.
Kalina
Telerik team
 answered on 15 Jun 2010
2 answers
66 views
I have a question about customized the AdvacedForm with an ASP.Net FileUpload control.
I added the FileUpload control to the AdvancedForm so a user can upload file to the server when an appointment is created. When the Save button is clicked after selecting a file, everything seems going well since I do not see any errors. However, in my server-side code, for example, in handling UploadButton_OnClick event, I cannot catch any property of the FileUpload control. The control is posted back since I can access it by its ID, but the properties I am interested do have value. For example, FileName property is an empty string, the "HasFile" property returns a FALSE value. As such I cannot save the file or I do not have a file to save on post back.

Has this something to do with the fact that the AdvacedForm is an user control? I am asking this because when I have a FileUpload on the parent page with the Scheduler, I do not have any problem with catching the FileUpload control's properties.

Derek Feng
Top achievements
Rank 1
 answered on 15 Jun 2010
5 answers
245 views

Hi,

      this is Gupta. In my project we use maximum 7different telerik controls and if i use all those in a single page. something like i attached the screenshot..


For Disabling embedded resources , I made EnableembeddedScripts='false" to all the telerik controls and i added the custom script path to the script manager for all the controls required as written below. I added all the scripts in proper order. but its giving problems.

If i do this way , Some controls (radgrid,DatePicker etc.,)are not functioning correctly.

        <asp:ScriptManager ID="ScriptManager" runat="server">
            <Scripts>
For Menu

                <asp:ScriptReference Path="~/TelerikScripts/Common/Core.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/jQuery.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/jQueryPlugins.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/Navigation/NavigationScripts.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Menu/RadMenuScripts.js" />
            </Scripts>
            <Scripts>
For Multipage
                <asp:ScriptReference Path="~/TelerikScripts/TabStrip/MultiPage/RadMultiPageScripts.js" />
            </Scripts>
            <Scripts>
For TabStrip
                <asp:ScriptReference Path="~/TelerikScripts/Common/Scrolling/ScrollingScripts.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/Navigation/NavigationScripts.js" />
                <asp:ScriptReference Path="~/TelerikScripts/TabStrip/RadTabStripScripts.js" />
            </Scripts>
            <Scripts>
For DatePicker              
                <asp:ScriptReference Path="~/TelerikScripts/Input/TextBox/RadInputScript.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Input/DateInput/RadDateInputScript.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Calendar/RadCalendarCommonScript.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Calendar/RadCalendarScript.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Calendar/RadDatePicker.js" />
            </Scripts>
            <Scripts>
 For Grid             
                <asp:ScriptReference Path="~/TelerikScripts/Grid/RadGridScripts.js" />
            </Scripts>
            <Scripts>
                <asp:ScriptReference Path="~/TelerikScripts/Common/PopUp/PopUpScripts.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/jQuery.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/jQueryPlugins.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/Animation/AnimationScripts.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Window/RadWindow.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Window/RadWindowManager.js" />
            </Scripts>
            <Scripts>
                <asp:ScriptReference Path="~/TelerikScripts/Common/jQuery.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/jQueryPlugins.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/Animation/AnimationScripts.js" />
                <asp:ScriptReference Path="~/TelerikScripts/Common/PopUp/PopUpScripts.js" />
                <asp:ScriptReference Path="~/TelerikScripts/ToolTip/RadToolTip.js" />
                <asp:ScriptReference Path="~/TelerikScripts/ToolTip/RadToolTipManager.js" />
            </Scripts>
        </asp:ScriptManager>


CAn u please help me in this regard.
Peter
Telerik team
 answered on 15 Jun 2010
1 answer
104 views
Hi,

In the grid i have set the page styele mode as "NextPrevAndNumeric" if i filter and the result has more than one row (say 15 Rows) displayed then the message displays as "15 items of 2 Pages" is getting displayed. if the No. of row is one then it is displaying as "1 items of 1 Page " is getting displayed which needs to be changed as "1 item of 1 Page".

How do i fix this pls Help me to fix.

Jidesh
Dimo
Telerik team
 answered on 15 Jun 2010
2 answers
350 views
Perhaps you can shed light on a problem I can't seem to wrap my head around.

I have a page with a button and two panels.  On button click, I will run a merge process that will take a while to complete.  When the merge is completed, I'd like to update panel #1 with a complete messsage.  Then I'd like it to automatically fire another process which creates invididual files, and again will take a while to complete.  When that is finished, update panel #2 with a complete message.

I've tried tying the end of the first call to use AjaxManager's OnResponseEnd, but there's a slight problem.  Since the reponse is ending each time, it's getting fired over and over again.  Is there another way I can achive this functionality? 

My code so far:
        <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">  
            <script type="text/javascript">  
 
                function OnResponseEnd(sender, args) {  
 
                    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");  
                    ajaxManager.ajaxRequest("individual");  
                }  
                  
            </script> 
        </telerik:RadCodeBlock> 
          
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelMerge" runat="server" Skin="Office2007" /> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelIndividual" runat="server" Skin="Office2007" /> 
          
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">  
            <ClientEvents OnResponseEnd="OnResponseEnd" /> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="btnRun">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="pnlMerge" LoadingPanelID="RadAjaxLoadingPanelMerge" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="pnlIndividual" LoadingPanelID="RadAjaxLoadingPanelIndividual" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager>          
          
        <asp:Button runat="server" ID="btnRun" OnClick="btnRun_Click" Text="Run" /> 
          
        <table> 
            <tr> 
                <td> 
                    <asp:Panel runat="server" ID="pnlMerge" Height="100px" Width="200px" BorderWidth="1">  
                        <asp:Label runat="server" ID="lblMerge" /> 
                    </asp:Panel>                  
                </td> 
                <td> 
                    <asp:Panel runat="server" ID="pnlIndividual" Height="100px" Width="200px" BorderWidth="1">  
                        <asp:Label runat="server" ID="lblIndividual" /> 
                    </asp:Panel>                  
                </td> 
            </tr> 
        </table> 

        protected void btnRun_Click(object sender, EventArgs e)  
        {  
            // run the merge
            System.Threading.Thread.Sleep(2000);  
            lblMerge.Text = "Merge Complete";  
              
        }  
 
        protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)  
        {  
            if (e.Argument == "individual")  
            {  
                // run the individual
                System.Threading.Thread.Sleep(2000);  
                lblIndividual.Text = "Individual Complete";  
            }  
        } 

Thanks so much!

-- Mike
Mike
Top achievements
Rank 2
 answered on 15 Jun 2010
4 answers
1.1K+ views

Hello,

I have one simple one but having hard time to find a way to do it.
I want to prevent users to select row on client side with row click  on any other cell click but  allow only GridClientSelectColumn to select and unselect the row.

 

AllowMultiRowSelection

 

 

="true" on the grid

 

 

 

I have these settings on the mastertableview

 

<

 

 

ClientSettings AllowColumnsReorder="True">

 

 

 

 

 

 

 

<Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />

 

 

 

 

 

 

 

<Resizing AllowColumnResize="true" />

 

 

 

 

 

 

 

</ClientSettings>

Please guide me what should i do

 

Mac P
Top achievements
Rank 1
 answered on 15 Jun 2010
5 answers
181 views

In RadGrid, I'm using a FormTemplate. I need to use javascript on the FormTemplate controls when in edit mode. I couldn't find a way to tie events within the FormTemplate in the aspx page, so I'm assigning them in the grid's ItemCreated event, like so...

If (TypeOf e.Item Is GridEditFormItem) AndAlso (e.Item.IsInEditMode) Then 
    Dim item As GridEditFormItem = CType(e.Item, GridEditFormItem)  
    Dim chkName As CheckBox = CType(item.FindControl("chkName"), CheckBox)  
    Dim txtResult As RadTextBox = CType(item.FindControl("txtResult"), RadTextBox)  
    chkName.Attributes("onclick") = "NameChange('" & chkName.ClientID & "', '" & txtResult.ClientID & "');" 
End If 

Then in the client-side, the function looks something like the following...

function NameChange(chkNameClientID, txtResultClientID) {  
    var chkName = document.getElementById(chkNameClientID);  
    var txtResult = $find(txtResultClientID);  
    if (chkName.checked == false) {  
        txtResult.set_value('Joker');  
    } else {  
        txtResult.set_value('Batman');  
    }  

It works, but it seems a bit goofy to assign all my javascript calls on the server-side, pass all relevant ClientIDs and assign them to vars before working with them. So I'm wondering if this is the best way to do it, or if you recommend a different method and I'm going about it the hard way. Thanks.
Dimo
Telerik team
 answered on 15 Jun 2010
5 answers
143 views
Hello again.I would like to ask the following
a) I have inserted an asp.net page(the editor) inside an iframe.The problem is in IE7,8.
When i load my page(which includes the editor) ,the whole page is scrolled down to the editor(something like focus).
This doesn't happen in firefox and chrome.This is an important problem for me.
b)Can i create snippets by using javascript?
c)I have created a few custom buttons.When i press one custom button and i call a js function which opens a new window then,the window is opened but it lost focus.
My main page is focused.
d)I'm using something like this
function OnClientLoad(editor, args) {

            var style = editor.get_contentArea().style;
            editor.get_contentArea().style.cssText = "font-family:Tahoma,Serif !important;font-size:18px !important;background-color:#ff0000";
....
My question is,why the font family is not selected in the editor's drop down?The font size works!
e)Is it possible to call whatever is called when the InsertImage button is pressed,from my own custom button?

Sorry for so much questions but i try to see if i can customise it ,as i wish,in order to buy the product.
Thank you.
ps:I have noticed the following.When i use firefox and i insert visually a table i can't escape from it.
Moreover in many cases i don't see the caret(in firefox again).Are you aware of these problems?
Rumen
Telerik team
 answered on 15 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?