Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
206 views
In your example:

http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/contextmenu/defaultcs.aspx

On Deletion, you delete the node. I want to first check if there are any children for that node, and if so send a alert. How do I check if the selected TreeNode has children? The below treeNode.Nodes.length doesn't work. thanks!

 

case "Delete":

 

 

 

if (treeNode.Nodes.length > 0) {

 

alert(

 

"Please remove content of this directory prior to deletion.");

 

}

 

 

else {

 

 

 

var result = confirm("Are you sure you want to delete the item: " + treeNode.get_text());

 

args.set_cancel(!result);

}

 

 

break;

Shinu
Top achievements
Rank 2
 answered on 20 Jul 2009
1 answer
119 views
I have a button and a texbox in the Edit Template that I need to access from the code behind. I tried the following code and it didn't work, does anyone have an example of this?

 Dim btn As Button = TryCast(sender, Button) 
        Dim btnPanel As Panel = TryCast(btn.Parent, Panel) 
        Dim dataItem As GridDataItem = TryCast(btnPanel.NamingContainer, GridDataItem) 
        dataItem("Button1").Enabled = False 
 
 
        Dim txt As TextBox = TryCast(sender, TextBox) 
        Dim txtPanel As Panel = TryCast(txt.Parent, Panel) 
        Dim dtItem As GridDataItem = TryCast(txtPanel.NamingContainer, GridDataItem) 
 
 
 
 
        If (Utilities.FileExists("GlobalReports\" & dtItem("txtReportFile").Text)) Then 
        'Do some stuff 
End If 

Princy
Top achievements
Rank 2
 answered on 20 Jul 2009
1 answer
143 views
Hello all,

Is there a way for the row click to behave like expand? I ask this because I want the clicking of a RadGrid row to post back and then the CommandName be ExpandCollapse. This way, the ItemCommand event will only be called once.

Thanks
Shinu
Top achievements
Rank 2
 answered on 20 Jul 2009
3 answers
134 views
I need to have the insert row visible at all times, so I do something like the following. The problem is after the user tabs through adding data to the row and hits the insert button, when the insert row gets added again during Pre-Render as shown below, I want to be able to put the user focus back into the first cell of the insert row. Note: I use InsertCommand to actually persist the data into the object collection. Please help.

protected

 

void RadGrid1_PreRender(object sender, System.EventArgs e)

 

{

 

 

if (!RadGrid1.MasterTableView.IsItemInserted)

 

{

RadGrid1.MasterTableView.IsItemInserted =

true;

 

RadGrid1.Rebind();

}


}

Princy
Top achievements
Rank 2
 answered on 20 Jul 2009
1 answer
226 views
I am using a simple Access database. One of the fields contains URLs to images. IE: http://www.company.com/images/photo.jpg

Is there a way to have the image display in the column rather than the text of the field?

Thanks,

Allan
Shinu
Top achievements
Rank 2
 answered on 20 Jul 2009
2 answers
67 views
Hi Guys,
I have 2 issues with the rad editor.  I've dropped it into my page and I've set the width to 490 however the edit doesn't listen to any width sizes I give it.  It always seems to be the width of the toolbar minus the last button which it pushes strangely onto the next line in the toolbar.

Any ideas on how to make the editor width work?  and how to stop the toolbar doing a funny wrap to the next line I've looked all over the forums however nobody seems to be having the issue where the editor isn't following the width set in the properties.
Mal
Top achievements
Rank 1
 answered on 20 Jul 2009
0 answers
108 views
I do not know how to delete this question. It was based on incorrect information
andieje
Top achievements
Rank 1
 asked on 19 Jul 2009
0 answers
145 views
Hi,

I've a project which is shared by many people in the team. We use VSS for source control.
Now, I installed Telerik trial version and been working. Suddenly, on friday, my radcontrols and AJax toolkit somehow got missed from the toolbox(I don't know why maybe I got a new working folder from VSS ). . so, in toolbox i opened up a new tab and browsed for telerik.web.ui.dll.
and got the radcontrols.
I also got AJax toolkit.
But the version i found the toolbox radcontrols were having is   2009.1.537.20

In my project , the reference was pointing to 2009.1.402.35.
wat happens is when i go and see in the aspx/ascx in design mode, i get an ugly red messgae telling: Telerik[A] canot be cast into Telerik[b]. I know this is some reference (assembly) problem.

What do i need to do?

1) if i go ahead and change the reference in my project,ppl are already using  old refernce : telerik.web.ui version 2009.1.402.35
So, do u want me change all my refernces in c:/prog files/telerik/radcontrols for asp.net ajax q1 2009/bin35 to old refernce or leave it like that.

Whatr should i do to make it working.

I tried many things after browsing the forumns .b ut nothing HELPED. SO, PLS TELL ME WHAT I NEED TO FIX IT. PLS DO ASK ME TO READ ATICLES/BLOGS.

  wE'RE USING TRIAL VERSION AND ENVIRONMENT: XP/VISTA(SOMEPPL HAVE VISTA AND SOME XP)
                                                                                    .NET F/W 3.5, vs2008


123 456
Top achievements
Rank 1
 asked on 19 Jul 2009
3 answers
174 views
hi telerik,
i have a rad grid with an in data key column (studentId) and a drodown column.
When I click on a row to edit it, item_created is fired and i get the correct record studentId from DataBinder.eval.
I attach selectedIndexChanged method on item_created to the dropdown record from the dropdown column, and set it's autopostback to True.
Now when i change the value on the dropdown, the page postback as expected, and first itemcreated is fired (later my selectedindexchanged event is fired too). the problem is that now the student id is 0! meaning that on edit mode, if the post back occured from an inner control on the selected row, the key is not retreived.
is there a proper way to retreieve the record key?
Hadar Kaufman
Top achievements
Rank 1
 answered on 19 Jul 2009
4 answers
127 views
I am attempting to disable ajax for an upload control, which is enclosed in a usercontrol that is used for edits/inserts/etc. I am following the example found here: http://demos.telerik.com/aspnet-ajax/Controls/Examples/Integration/RadUploadInAjaxifiedGrid/DefaultCS.aspx?product=grid,

However,  

var upload = $find(window['UploadId']); 

Always fails because

 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
            if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                RadUpload upload = (RadUpload)e.Item.FindControl("RadUpload1"); 
                RadAjaxPanel1.ResponseScripts.Add(string.Format("window['UploadId'] = '{0}';", upload.ClientID)); 
            } 
        } 


Does not find my upload control, presumably because it is in the usercontrol. How would I go about finding the RadUpload within the UserControl in order to disable the ajax and upload files?
Suresh K
Top achievements
Rank 1
 answered on 18 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?