Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
277 views

Hi. I'm trying to use findControl on a RadTreeNode on the client side to locate a radio button I have in the NodeTemplate, and I can't get it to locate it. I have tried just passing in the ID of the radio button in the code (RB1), and also the full client ID from the generated html. Each time, the control comes up null. 

Also, is there is a way to get the client id of the current node if I have to construct the radio buttons client id?

One more: are there any other ways to access the controls under the node? Use the DOM? Is there a collection of controls availabe?

Thanks,
Brian

        <telerik:RadTreeView ID="RadTreeView1" runat="server" Skin="Office2007"   
             OnClientNodeClicked="RadTreeView1_NodeClick" ShowLineImages="True" > 
            <Nodes> 
                <telerik:RadTreeNode runat="server" Text="Produce">  
                    <NodeTemplate> 
                        <div> 
                            <asp:RadioButton runat="server" ID="RB1" Text="Produce" GroupName="StandardTags" /><br /> 
                        </div> 
                    </NodeTemplate> 
                </telerik:RadTreeNode> 
            </Nodes> 
        </telerik:RadTreeView> 
 

In the js:

function RadTreeView1_NodeClick(sender, eventArgs)  
{  
   var node = eventArgs.get_node();      
   var strControl = "RadTreeView1_i0_RB1";  
   var radio = node.findControl(strControl);  
??? radio is null  
}  
 

Veselin Vasilev
Telerik team
 answered on 30 Nov 2009
5 answers
275 views

Hi,
The radcombobox does not expand when i have dropdowncssclass ="multipleRowsColumns"  , it works fine when i remove the property. here is the code,  any thoughts ?

<

 

telerik:RadComboBox ID="Country" runat="server" Skin="Sunset"

 

 

DataSourceID="Country" DataTextField="Text" DataValueField="Value"

 

 

DropDownCssClass="multipleRowsColumns" DropDownWidth="460px" AllowCustomText="false" >

 

 

</telerik:RadComboBox>

 

Simon
Telerik team
 answered on 30 Nov 2009
1 answer
134 views
Hi

I have date columns in the RADGRID as shown below

<

telerik:GridDateTimeColumn DataField="dtCreatedOn" DataType="System.DateTime" DataFormatString="{0:M/dd/yyyy}"

 

 

FilterControlWidth="120px" HeaderText="Created On" SortExpression="dtCreatedOn"

 

 

UniqueName="dtCreatedOn">

However the filter menu options listed below do not function

EqualTo: Not working
NotEqualTo: Not working
Greaterthan: Not working proper (NOTE: working as Greater than Equal)
LessThanOrEqualTO: Not working (Note: Working as Lessthan)

I need help on this

thanks
MS

 

Princy
Top achievements
Rank 2
 answered on 30 Nov 2009
1 answer
94 views
Hi,

I need to create Nested Grid to some of the rows(based on DB results of the parent Grid). So, I need to add 'Expand' symbol for some rows only. Please let me know, how proceed on this? It would be great, if you can provide some sample code.

Thanks,
Malli
Shinu
Top achievements
Rank 2
 answered on 30 Nov 2009
3 answers
373 views
I have a RadComboBox that gets dynamically loaded onto a web page at runtime.  Most of the time, it displays fine.  However, once in a while, the down-arrow is not visible and I see the text "select" instead, and when that occurs the actual dropdown selections render as text over my page background rather than in a visible list with highlighting.

More specifics on how the page works:

I have a number of .ascx files for different controls, one of which is the combobox.  Here is the entire markup of the .ascx file:

<%

@ Control Language="C#" AutoEventWireup="true" CodeBehind="ComboBox.ascx.cs" Inherits="PortalGridPage.ComboBox" %>

 

 

<%

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

 

 

 

<

asp:Panel runat="server" ID="ComboBoxPanel" CssClass="ComboBoxPanel">

 

 

 

        <asp:Label runat="server" ID="TheLabel" >

 

 

 

        </asp:Label>

 

 

 

        <radUI:RadComboBox runat="server" ID="TheComboBox"

 

 

 

                EnableEmbeddedScripts="True"

 

 

 

                AllowCustomText="True" AutoPostBack="True" >

 

 

 

        </radUI:RadComboBox>

 

 

</

asp:Panel>

 

 

 

 

 


At runtime, based on some configuration info, this .ascx get dynamically loaded within a dynamically built page.

Here is the markup of the page:

<

head runat="server">

 

 

 

        <title></title>

 

 

</

head>

 

 

<

body>

 

 

 

<form id="form1" runat="server">

 

 

 

        <asp:ScriptManager id="ScriptManager" ScriptMode="Release" runat="server" />

 

 

 

        <script type="text/javascript" src="PortalConfigPage.js"></script>

 

 

 

        <script type="text/javascript" src="..\WebResourcesAjax\ValcoGridPanel\Scripts\ValcoGridPanel.js"></script>

 

 

 

        <div>

 

 

 

                <radUI:RadWindowManager ID="TheWindowManager" runat="server"

 

 

 

                                        Skin="Default" >

 

 

 

                        <Windows>

 

 

 

                                <radUI:RadWindow ID="TheChildWindow" runat="server" Height="400px" Width="700px"/>

 

 

 

                        </Windows>

 

 

 

                </radUI:RadWindowManager>

 

 

 

                <radUI:RadAjaxLoadingPanel ID="TheAjaxLoadingPanel" runat="server" Transparency="15"

 

 

 

                                IsSticky="True" Style="position: absolute; left: 200; top: 60; z-index: 999;"

 

 

 

                                Height="240px" Width="240px">

 

 

 

                                <asp:Image ID="Image1" runat="server" Height="160px" Width="240px" AlternateText="Loading..." />

 

 

 

                </radUI:RadAjaxLoadingPanel>

 

 

 

                <RadUI:RadAjaxPanel ID="TheAjaxPanel" runat="server"

 

 

 

                                EnableAJAX="True" EnableEmbeddedScripts="True" LoadingPanelID="TheAjaxLoadingPanel"

 

 

 

                                EnableViewState="True" >

 

 

 

                        <asp:Button ID="EditLayout" runat="server" EnableViewState="False" Text="Edit Page Config" />

 

 

 

                        <asp:Panel ID="ControlArea" runat="server"

 

 

 

                                EnableViewState="True" >

 

 

 

 

 

 

                        </asp:Panel>

 

 

 

                        <asp:Button ID="SaveLayout" runat="server" EnableViewState="False" Text="Save Config" />

 

 

 

                        <asp:Button ID="CancelButton" runat="server" EnableViewState="False" Text="Cancel" />

 

 

 

                </RadUI:RadAjaxPanel>

 

 

 

        </div>

 

 

 

</form>

 

 

</

body>

 

 

</

html>

 

 

 

 

 


The combobox.ascx gets loaded as a child control of the "ControlArea" panel in the page.  In the code-behind for the ComboBox.ascx, I set the fact that we are using embedded skins and the name of the skin based on values in my web.config.  In this case, I set EnableEmbeddedSkins to true and I set the Skin to "WebBlue".  I do this in my override OnInit handler as shown below:

 

 

 

 

base.OnInit(e);

 

 

 

TheComboBox.EnableEmbeddedSkins = PortalGridPage.Properties.

Settings.Default.UseEmbeddedSkins;

 

TheComboBox.Skin = PortalGridPage.Properties.

 

Settings.Default.Skin;

 

 



As you can see in the page markup, the ControlArea panel is inside a RadAjaxPanel, so that interactions with any of my dynamically laoded controls will be able to cause other controls to update.  In this case, I happen to have a control that selects whether or not the dynamicaly loaded ComboBox is visible or not (sets the visibility of the ComboBox.ascx).  Sometimes, when visibility of the ComboBox.ascx becomes True, the displayed RadComboBox does not show the down arrow graphic or the slider area for selection except as text.  This happens in IE7, Firefox, and Chrome, so it is definitely not browser specific.  One thing I do find interesting, but I haven't put my finger on it, is that if I use my Firefox plugin tools to inspect the elements on the page, whereas my RadGrid stuff (that is dunamically loaded on the same page as well in another .ascx) always reflects using WebResource.axd, when I inspect the combo box it is not showing use of WebResource.axd, whether it is displaying properly (matching the WebBlue skin as expected) or whether it is in this odd display problem.  In neither case do my firefox plugin tools show that file as the source of the styles for the combobox, which is odd because the only other stylesheet loaded doesn't duplicate any of the class names for the RadComboBox stuff, so the fact the WebBlue skin is being reflected in the visual look when it is displaying correctly suggests to me it must be finding the WebResource.axd file.

By the way, i am using version 2008.3.1314.35 of the Telerik controls.

Thanks,

Ed Hinton

Paul
Telerik team
 answered on 30 Nov 2009
1 answer
115 views
Hi,

   I have a radgrid which will be filled on the page_load method of my page. On selection of the row in radgrid some controls are filled
on my page at client side using OnRowSeleted event.
here,I need to default the row selection to first row and need to call the OnrowSelected event explicity to fill my controls.
I got succeded on selecting the first row by default using RadGrid1.MasterTableView.Items[0].Selected = true;
But,
My OnRowSeleted client side event is not fired, So i was not able to Load the controls according to my default row selection.
Please guide me on this senario.

Thanks,
Nagendra
Daniel
Telerik team
 answered on 30 Nov 2009
8 answers
204 views
Hello All,
       According to my functionality i need a grid dynamically generated in which first three columns are non editable and rest ( not known) are editable. So i buit it  from server side using Template columns and RADNumericTextbox. 

private

class myNTemplate : ITemplate

 

{

 

string TempField = string.Empty;

 

 

public myNTemplate(string Field)

 

{

TempField = Field;

}

#region

ITemplate Members

 

 

public void InstantiateIn(Control container)

 

{

 

RadNumericTextBox ntextBox = new RadNumericTextBox();

 

ntextBox.EnableEmbeddedSkins =

false;

 

ntextBox.Width =

Unit.Pixel(25);

 

ntextBox.ID =

"ntxt_" + TempField;

 

ntextBox.DataBinding +=

new EventHandler(ntextBox_DataBinding);

 

container.Controls.Add(ntextBox);

}

 

void ntextBox_DataBinding(object sender, EventArgs e)

 

{

 

RadNumericTextBox ntextBox = (RadNumericTextBox)sender;

 

 

GridDataItem container = (GridDataItem)ntextBox.NamingContainer;

 

 

string fieldValue = DataBinder.Eval(container.DataItem, TempField).ToString();

 

ntextBox.Text = (

string)((DataRowView)container.DataItem)[TempField];

 

}

#endregion

}

As the gris is ready i started entering values in each of mueric box in each column and need to insert into Db
As they were template columns i used FindControls to get the values and found only null was returning, not able to find the reason, for this iam sending my code for inserting

 

 

foreach (GridDataItem item in this.Rg_LOB.MasterTableView.Items)

 

{

_obj_smhr_lob.LOB_EMPID =

Convert.ToInt32(item.Cells[2].Text);

 

 

for (int j = 0; j < Rg_LOB.Columns.Count - 5; j++)

 

{

strQry.Append(

"EXEC USP_SMHR_LEAVEOPENINGBALANCES ");

 

_obj_smhr_lob.LOB_EMPID =

Convert.ToInt32(item.Cells[2].Text);

 

 

string LT = Convert.ToString(Rg_LOB.MasterTableView.Columns[j + 4].UniqueName);

 

 

string[] T = LT.Split(new char[] { '-' });

 

_obj_smhr_lob.LOB_LEAVETYPEID =

Convert.ToInt32(T[0]);

 

 

string ctrl = "ntxt_" + LT;

 

 

RadNumericTextBox ntxt;

 

ntxt = (

RadNumericTextBox)item[this.Rg_LOB.MasterTableView.Columns[j + 4].UniqueName].FindControl(ctrl);

 

 

_obj_smhr_lob.LOB_NOOFDAYS =

Convert.ToInt32(ntxt.Text);

 

_obj_smhr_lob.LOB_FINALISE = 0;

_obj_smhr_lob.LOB_CREATEDBY = 1;

_obj_smhr_lob.LOB_CREATEDDATE = System.

DateTime.Now;

 

_obj_smhr_lob.LOB_LASTMDFBY = 1;

_obj_smhr_lob.LOB_LASTMDFDATE = System.

DateTime.Now;

 

_obj_smhr_lob.OPERATION =

operation.Insert;

 

 

string str = "@Operation = 'Insert'" +

 

 

",@LOB_EMPID = '" + _obj_smhr_lob.LOB_EMPID + "'" +

 

 

",@LOB_LEAVETYPEID = '" + _obj_smhr_lob.LOB_LEAVETYPEID + "'" +

 

 

",@LOB_NOOFDAYS = '" + _obj_smhr_lob.LOB_NOOFDAYS + "'" +

 

 

",@LOB_FINALISE = '" + _obj_smhr_lob.LOB_FINALISE + "'" +

 

 

",@LOB_CREATEDBY = '" + _obj_smhr_lob.LOB_CREATEDBY + "'" +

 

 

",@LOB_CREATEDDATE = '" + _obj_smhr_lob.LOB_CREATEDDATE + "'" +

 

 

",@LOB_LASTMDFBY = '" + _obj_smhr_lob.LOB_LASTMDFBY + "'" +

 

 

",@LOB_LASTMDFDATE = '" + _obj_smhr_lob.LOB_LASTMDFDATE + "'";

 

strQry.Append(str);

}

}

I kept the line in bold where iam getting null. Please help me out in finding the error

Thanks
MKD

Nikolay Rusev
Telerik team
 answered on 30 Nov 2009
2 answers
222 views
Hi,

I have multiview calendar control. I could able to bind the selected dates in the calendar control. I need to show the calendar as  a readonly control. I should not allow the user to select dates from the calendar, If i give enabled="false" property then I could not view my selected dates in the calendar.
<telerik:RadCalendar ID="RadCalendar1"    
                              runat="server" Font-Names="Arial, Verdana, Tahoma"
                            MultiViewColumns="3" MultiViewRows="2"  
                             >
                        </telerik:RadCalendar>
.cs:
                RadCalendar1.SelectedDates.Add(new RadDate(DateTime.Today));
                RadCalendar1.SelectedDates.Add(new RadDate(2009, 11, 11));
Pls help me





jeevitha
Top achievements
Rank 1
 answered on 30 Nov 2009
2 answers
114 views
Hello Lovers and Friends

I am using RadGrid Q2 2008
I want to expand the radgrid using JavaScript, How does one achieve that,
meaning that I Have a radgrid with a detailsTable, I want to automatically expand the table when a user moves a mouse

thank you in advance!
Nkululeko Mthethwa
Top achievements
Rank 1
 answered on 30 Nov 2009
1 answer
160 views
Hi

I want to implement big tail with tooltip at this time tail is very small can any body help?

Thanks
Svetlina Anati
Telerik team
 answered on 30 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?