Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
102 views
Im using following code to bind RadTreeView on my master page.i need to maintain expand state of the treeview on postbacks.how can i do this with the following code

    public void GenrateTreeView()
    {
        DataSet myDataSet;
        if (sUserName.Trim().ToLower() == "lyle.stanley")
             myDataSet = GetData3();
        else if (sUserName.Trim().ToLower() == "aaron.mchugh")
            myDataSet = GetData3();
        else if (sUserName.Trim().ToLower() == "deven.sumputh")
            myDataSet = GetData3();
        else if (sUserName.Trim().ToLower() == "arun.thavasi")
            myDataSet = GetData3();
        else if (sUserName.Trim().ToLower() == "warren.farrow")
            myDataSet = GetData();
        else if (sUserName.Trim().ToLower() == "jude.clephas")
            myDataSet = GetData();
        else if (sUserName.Trim().ToLower() == "david.moran")
            myDataSet = GetData();
        else if (sUserName.Trim().ToLower() == "emilee.macdonald")
            myDataSet = GetData3();
        else
            myDataSet = GetData2();
        RadTreeNode parentHome = new RadTreeNode("PinC Document Control System");
  
        treeView.Nodes.Add(parentHome);
     
        treeView.ShowLineImages = true;
        treeView.Skin = "Web20";
        lchilNodes.Clear();
 


        try
        {
            foreach (DataRow parentRow in myDataSet.Tables["tblParent"].Rows)
            {
              
                RadTreeNode parentNode = new RadTreeNode((string)parentRow["ParentName"]);
              
                treeView.Nodes.Add(parentNode);
               


                foreach (DataRow childRow in parentRow.GetChildRows("Child"))
                {


                    RadTreeNode childNode = new RadTreeNode((string)childRow["ChildName"]);
                    if (lchilNodes.Exists(delegate(RadTreeNode match)
                    {
                        return match.Text == childNode.Text;
                    }
                            ))
                    {
                        lchilNodes.Remove(new RadTreeNode(childNode.Text));


                    }
                    else
                    {
                        lchilNodes.Add(new RadTreeNode(childNode.Text));
                       
                        parentNode.Nodes.Add(childNode);
                    
                    }
                }




            }
        }


        catch (Exception ex)
        {


        }
        finally
        {
        
        }


    }

Shinu
Top achievements
Rank 2
 answered on 29 Oct 2011
1 answer
150 views
Hi guys,
I have a user control coding:

table

 

>

 

<

 

tr>

 

<

 

td>

 

 

<asp:RadioButton ID="rbEISId" runat="server" CausesValidation ="false" AutoPostBack="true" GroupName ="rbID" Checked ="true" Text ="EIS ID" OnCheckedChanged="rbEISId_CheckedChanged" /></td>

 

<

 

td>

 

 

<asp:RadioButton ID="rbPMSId" runat="server" CausesValidation ="false" AutoPostBack="true" style="background-color :Transparent;" GroupName ="rbID" Text ="PMS ID" /></td>

 

<

 

td>

 

 

<asp:RadioButton ID="rbSSN" runat="server" CausesValidation ="false" AutoPostBack="true" style="background-color :Transparent;" GroupName ="rbID" Text ="SSN" OnCheckedChanged="rbSSN_CheckedChanged" /></td>

 

</

 

tr>

 

<

 

tr>

 

<

 

td colspan="3">

 

<

 

div id="divEIS">

 

<

 

div id="divEIS1" runat="server" style="text-align :center ;" >

 

 

<telerik:RadTextBox ID="txtEISId" MaxLength ="9" runat="server" Font-Bold ="true" Font-Size ="10" Height="16">

 

 

</telerik:RadTextBox></div></div>

 

 

<div id="divSSN">

 

 

<div id="divSSN1" runat="server" >

 

 

<telerik:RadMaskedTextBox ID="txtSSN" runat="server" Mask="###-##-####" Font-Bold ="true" Font-Size ="10" Height="16">

 

 

</telerik:RadMaskedTextBox></div></div>

 

</

 

td>

 

</

 

tr>

 

</

 

table>

 


Now I have a page which access this user control:

<%

@ Page Language="C#" MasterPageFile="~/EISMaster.Master" AutoEventWireup="true" CodeBehind="CentralUsersReport.aspx.cs" Inherits="EISPortal.PerSession.CentralUsersReport" Title="Untitled Page" %>

 

<%

@ Register Src="../Controls/Menu_PrincipalPS.ascx" TagName="Menu_PrincipalPS" TagPrefix="uc1" %>

 

<%

@ Register Src="../Controls/EMP_IDs.ascx" TagName="EMP_IDs" TagPrefix="uc2" %>

 

<%

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

 

The user control is EMP_IDs

<

 

telerik:RadScriptManager ID="ScriptManager1" runat="server" />

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<ClientEvents OnRequestStart="onRequestStart" />

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="mainPanel">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="mainPanel" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" EnableSkinTransparency ="true" runat="server">

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 

<asp:Panel ID="mainPanel" runat="server">

 

 

<br />

 

<%

--<br />--%>

 

 

<div id="SearchDiv" style="width:100%">

 

 

<fieldset>

 

 

<legend>Search Principal Requests</legend>

 

 

<table>

 

 

<tr>

 

 

<td style="padding-left:170px;">

 

 

<label>

 

CFN:

 

</label>

 

 

<br />

 

 

<telerik:RadComboBox ID="ddlCFN" runat="server" Width="200px" Filter="Contains" MarkFirstMatch="true" AllowCustomText="false" Font-Size="Small" OnSelectedIndexChanged="ddlCFN_SelectedIndexChanged">

 

 

</telerik:RadComboBox>

 

 

</td>

 


In ddlCFN  onselectindexchanged I need to disable RadTextBox which is reside in user control.
How can I do that on server side or client side?

Thanks so much for your help.
Shinu
Top achievements
Rank 2
 answered on 29 Oct 2011
3 answers
303 views
function RadTreeView_OnClientContextMenuItemClicked(sender, args) {  
 
               var node = args.get_node();  
               var menuItem = args.get_menuItem();  
                 
               if (node.get_level() != 0) {     
                var parentNode = node.get_parent();            
            
               switch (menuItem.get_value()) {        
                     
                   case "Edit":  
                       {  
                           window.radopen("EditFormCS.aspx?ProgName=" + node.get_text() + "&MgrName=" + parentNode.get_text(), "UserListDialog");  
                           break;  
                       }  
                   case "Manager":  
                       {  
                           window.radopen("AddManagerCS.aspx", "UserListDialog");  
                           break;   
                       }  
                   case "Program":  
                       {  
                           window.radopen("AddProgramCS.aspx?Name=" + node.get_text(), "UserListDialog");  
                           break;  
                       }  
                   case "Delete":  
                       {  
                           window.radopen("DeleteFormCS.aspx?ProgName=" + node.get_text(), "UserListDialog");  
                           break;  
                       }  
                   default: break;  
               }  
               }  
 
           }           

I need to get parent node text to pass it as a variable in my contextmenu items. Could you please tell me how to get this kind of functionality.
Princy
Top achievements
Rank 2
 answered on 29 Oct 2011
6 answers
147 views
I am using a radgrid with filtering enabled to display a report. The full report contains ~16000 records and takes upwards of 1 minute to load. When I use the built in filtering to filter by a column it still takes just as long to load. I'm using linq to provide the datasource and I would assume it would be faster to query linq with the filter directly. I ran the linq generated query directly on the database with the added filter and sure enough it took less than a second to get the much reduced dataset (~70 rows).
So it seems like the radgrid is query all 16000 records from the database and then internally filtering down to 70 rows. So the question is, is the correct behaviour and if it is, is there a way to add the filter directly to the linq query?
Monte
Top achievements
Rank 1
 answered on 28 Oct 2011
2 answers
70 views
I have a two RadDateInput fields: one to contain the date itself, and the other to contain the time in military format.  I also have a "Now" button that I want to allow the user to push and populate the fields with the current date and time.  The date field works, but the time does not.  The time field gets '00:00'.  I am trying to do this client-side to avoid the round-trip.

The code in my ASPX page contains:

function setReqDateNow() {
    var d = new Date();
    var reqDate = $find("<%= reqDate.ClientID %>");
    var reqTime = $find("<%= reqTime.ClientID %>");
    reqDate.set_selectedDate(d);
    reqTime.set_selectedDate(d);
}
 
...
 
<telerik:RadDateInput ID="reqDate" runat="server" DisplayDateFormat="MM/dd/yyyy" Width="75" BackColor="#fbf5bb" />
<telerik:RadToolTip ID="tipReqDate" runat="server" HideEvent="LeaveTargetAndToolTip" TargetControlID="reqDate"
    Position="BottomRight" RelativeTo="Element" ShowEvent="OnMouseOver"
    Text="mm/dd/yyyy format less than or equal to today's date" />
   
<telerik:RadDateInput ID="reqTime" runat="server" DisplayDateFormat="HH:mm" Width="50" BackColor="#fbf5bb" />
<telerik:RadToolTip ID="tipReqTime" runat="server" HideEvent="LeaveTargetAndToolTip" TargetControlID="reqTime"
    Position="BottomRight" RelativeTo="Element" ShowEvent="OnMouseOver"
    Text="Enter time in hh:mm format" />
   
<asp:Button ID="btnNow" runat="server" Text="Now" OnClientClick="setReqDateNow();return false;" />

When the user clicks the button, it populates the date field, but it puts 00:00 in the time field.

Thank you in advance for your help!
Steve LaForge
Top achievements
Rank 1
 answered on 28 Oct 2011
4 answers
102 views
Hi, I'm having an annoying problem. When I select an item in the grid, the page automatically scrolls so the selected item is centered on the screen.
This behaviour is very annoying when I try to double-click an item 'cos the page scrolls on my first click and I end up doing my second click
somewhere else on the page.

Is there a way to disable this auto-scroll behavior?

Regards,
Santiago.
Diego
Top achievements
Rank 1
 answered on 28 Oct 2011
4 answers
791 views
i need to disable Gridbuttoncolumn where my value=0 if my value =1 Gridbuttoncolumn still show i try to use this code

For i = 0 To dt.Rows.Count - 1
          Dim dd As String = dt.Rows(i).Item("StatusCode").ToString
          If dd <> "0" Then
              RadGrid1.MasterTableView.Columns.FindByUniqueName("Accept").Visible = False
           End If
       Next

but if  dd <> 0  on the last of row button name "Accept" will be not show all of row
Luis
Top achievements
Rank 1
 answered on 28 Oct 2011
1 answer
59 views
Greetings,

I have a GridTemplateColumn on my grid :

<telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
    <ItemTemplate>
        <asp:HyperLink ID="EditLink" runat="server" Text="Participants"></asp:HyperLink>
    </ItemTemplate>
</telerik:GridTemplateColumn>

When i click on it,the program goes here to send the ID of the row:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
 
    if (e.Item is GridDataItem)
    {
 
        HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
        editLink.Attributes["href"] = "#";
        editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["idRDV"], e.Item.ItemIndex);
 
    }
 
 
}

BUT when i try to insert a new record on my grid, the program goes also here and create an ArgumentOutofRangeException

basically, it says : the index is out of range. Must be non-negative and less than the size of the collection. Parameter name: index


Can anyone help me ? thanks in advance
Tsvetina
Telerik team
 answered on 28 Oct 2011
4 answers
178 views
I have a radComboBox that I populate with data from a datatable. We do not allow custom text, so the first record is blank in case a user doesn't want to save any data from the comboBox. If the comboBox is loaded with items in the aspx page:
<telerik:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="false" MarkFirstMatch="true"
    Width="100px" DropDownWidth="150px" MaxHeight="350px" NoWrap="true" HighlightTemplatedItems="true"
    ExpandDirection="Down">
    <Items>
        <telerik:RadComboBoxItem Text=" " Value="" />
        <telerik:RadComboBoxItem Text="Female" Value="F" />
        <telerik:RadComboBoxItem Text="Male" Value="M" />
        <telerik:RadComboBoxItem Text="Unknown" Value="U" />
    </Items>
</telerik:RadComboBox>
the first highlighted row will have the same height as the rows with data.

If the comboBox is loaded from a datatable, the first row height is about 1/4 the height of the rows with data. See the attached jpg. Is there a way to make all the rows the same height when loaded from a datatable. I did try this with different skins and got the same effect.
<telerik:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="false" MarkFirstMatch="true"
    Width="100px" DropDownWidth="150px" MaxHeight="350px" NoWrap="true" HighlightTemplatedItems="true"
    ExpandDirection="Down">
    <ItemTemplate>
        <table style="width: 110px; text-align: left; font-size: 8pt" cellspacing="0" cellpadding="0">
            <tr>
                <td width="110px">
                    <%#DataBinder.Eval(Container.DataItem, "LookUp_List_Description")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</telerik:RadComboBox>
The comboBox is actually part of an ascx control used for lookup items and is fully dynamic. All I have to do is set a property for the type of lookup data the box will self load.
  
I am using Telerik.Web.UI version 2011.2.712.35
Ivana
Telerik team
 answered on 28 Oct 2011
7 answers
165 views

I need to do something similar to that you have in this example

http://demos.telerik.com/aspnet-ajax/tooltip/examples/loadondemand/defaultcs.aspx but imagine that in the control that embedded in a tooltip is an update control and I’m changing product name, so after I finished updating my fields I need to refresh my parent page. How do I do that? I’m using the same control tree similar to what you have in your example.

  1. Have a parent page (user control)
  2. Have a telerik:RadListBox that is bound and on ItemDataBound I add TargetControls collection
  3. On OnAjaxUpdate I instantiate my “Update User Control”.  I have “Save” button on it so when action is taken in “Update” control I need to refresh my Parent page with new info
Marin Bratanov
Telerik team
 answered on 28 Oct 2011
Narrow your results
Selected tags
Tags
+124 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?