Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
125 views
I am trying to raise and handle events, between ASP.NET user controls (ascx) files.

So basically, I have an aspx page that contains two ascx user controls.
I raise an event from one of them, and handle the event in the other.

To make it very simple to code this, I've exposed (declared) each user control as public, in the code behind of the aspx page.  Again, that makes it easy to do code all of this without having to do FindControl to get the controls.

In my main page for instance, I would have:

        public UCQueueItem ucQueueItem;
        public UCFiling ucFiling;

Each of these are user controls.  I can then raise an event in one, and handle it in the other if I simple "wire" the event up from the main page, like so:

this.ucFiling.FilingChangedEvent += new FilingDetailsChangedEventHandler(ucQueueItem.Update_OnFilingDetailsChanged);

That all works well and good, UNTIL I use a RadPanelBar and include my ucQueueItem user controls within the panel bar.  Since it then becomes a child of your control, I can no longer use the above syntax to wire up the event.  THIS STINKS.  I then have to do whacky "FindControl" stuff...

This type of behavior happens with all of your controls (like the grid, if you put items within Templates in the grid as well).

WHY WHY WHY, cannot I not access my publicly exposed controls, when they are nested within your controls?
Brent

Brent
Top achievements
Rank 1
 answered on 26 Sep 2008
4 answers
112 views
The editor is working fine. I can edit and spellcheck. But, when I click the Find&Replace button the popup dialog has the following error...

Could not load the file or assembly 'RadEditor' or one of its dependencies. The system cannong find the file specified.

What gets me is that I am using the .NET2 editor. why would it be telling me about 'RadEditor' instead of 'RadEditor.Net2' ?

thanks ahead of time...

mike
Serrin
Top achievements
Rank 1
 answered on 26 Sep 2008
4 answers
102 views
The example from this post is for an older version of the tree.  http://www.telerik.com/community/code-library/submission/b311D-dhkhe.aspx

My updated code is not working.  Any ideas?


Try

Select Case e.MenuItem.Text.ToLower

Case "delete"

e.Node.Remove()

statusLabel.Text =

"You deleted " & e.Node.Text

' save the changes

 

Case "move up"

'move the selected node one place up

'here's what we're gonna do:

'Check if this node is already at the top

'If not, switch it with the node directly above him, same goes for moving the node down...

If Not e.Node.Value = e.Node.ParentNode.Nodes(0).Value Then

Dim i As Integer = 0

While i < e.Node.ParentNode.Nodes.Count

If e.Node.Value = e.Node.ParentNode.Nodes(i).Value Then

'Because of the i-value, we are going to 'walk' through the

'second layer of the tree (radtreeview1.nodes(0).nodes)

'This part is a bit nasty programming, first we remove the node before the node we want to move

'our nodeclicked is now automatically moving one place up,

'than we insert the removed node one place under the moved node

'et voila

Dim tempNode As New Telerik.Web.UI.RadTreeNode

tempNode = e.Node.ParentNode.Nodes(i - 1)

m_RadTreeFolderHierarchy.Nodes(0).Nodes.RemoveAt(i - 1)

m_RadTreeFolderHierarchy.Nodes(0).Nodes.Insert(i, tempNode)

End If

i += 1

End While

End If

Case "move down"

'move the selected node one place down

If Not e.Node.Value = e.Node.ParentNode.Nodes(e.Node.ParentNode.Nodes.Count - 1).Value Then

Dim i As Integer = 0

While i < e.Node.ParentNode.Nodes.Count

If e.Node.Value = e.Node.ParentNode.Nodes(i).Value Then

'Because of the i-value, we are going to 'walk' through the

'second layer of the tree (radtreeview1.nodes(0).nodes)

'This part is a bit nasty programming, first we remove the node AFTER the node we want to move

'our nodeclicked is now automatically moving one place down,

'than we insert the removed node one place ABOVE the moved node

'et voila

Dim tempNode As New Telerik.Web.UI.RadTreeNode

tempNode = e.Node.ParentNode.Nodes(i + 1)

m_RadTreeFolderHierarchy.Nodes(0).Nodes.RemoveAt(i + 1)

m_RadTreeFolderHierarchy.Nodes(0).Nodes.Insert(i, tempNode)

Exit While

End If

i += 1

End While

End If

End Select

treeview_SaveChanges()

Catch ex As Exception

Bob
Top achievements
Rank 1
 answered on 26 Sep 2008
2 answers
139 views
I have a user control in a dynamically created RadPageView inside of an additional RadMultiView.  When you click to select a tab it display, if you move the mouse off of the user control then the user control disappears.  I have the same user control in an another dynamically created RadPageView in a different window (it is in a Wizard control instead of a RadMultiView) and this doesn't happen.

Here are a couple of screen shots:



urbanBaldGuy
Top achievements
Rank 1
 answered on 26 Sep 2008
4 answers
497 views
Hi,
I'm using an IList<T> of complex objects that are composed of other complex objects as properties.  I can get the RadGrid to sort ok on a regular property of type string.  But when I try to sort on a property that contains another business object, I get this error:

At least one object must implement IComparable.

This is what my code looks like:

<telerik:GridBoundColumn DataField="BatchNumber" HeaderText="Batch Number" SortExpression="BatchNumber" />

<telerik:GridTemplateColumn HeaderText="Client" SortExpression="Client">                   
     <ItemTemplate><%# (((Batch)Container.DataItem).Client).Name %>
     </ItemTemplate>
</telerik:GridTemplateColumn>


The blue property works fine.  I can't figure out what should go in the SortExpression property to show I want the Name property from the Client object to determine my sorting.

Thanks!
Troy

Rosen
Telerik team
 answered on 26 Sep 2008
2 answers
130 views
Is there any way to get the total item count for a grid when using custom paging with the objectdatasource? I would like to update a label outside the grid with the total number of records returned by the query. The objectdatasource has the selectcount method which tells the grid total records. If anyone would tell me what event and property to use to access that count in either the objectdatasource or the radgrid so i could set the label that would be great.
KevinMc
Top achievements
Rank 1
 answered on 26 Sep 2008
3 answers
156 views
It's not a problem to get parent data by get_parentView() and get_parentRow(). How to get child tableview or items on client-side if a parent row is selected?
In particular, I need to select all child items when the parent row was selected.
miksh
Top achievements
Rank 1
Iron
 answered on 26 Sep 2008
2 answers
187 views
Hi

I am using Telerik controls 2008 Q2. (Will get Q2 SP1 in a few days)

We currently use a Telerik RadScriptManager to take advantage of combining Telerik scripts and this has always worked nicely.

However the new VS2008 SP1 now has a feature for combining scripts as well that don't require resource assemblies. We want to use this as we also have custom scripts that we want to combine.

Basically I want all the Telerik scripts and our custom scripts to be combined into 1 request. I don't want 1 request for Telerik scripts and another request for my scripts.

What would be the best approach?

Should I disable the RadScriptManager so that it doesn't automatically combine Telerik scripts, and then use the enhanced VS2008 SP1 ScriptManager to combine my scripts along with Telerik instead?

Any advice is appreciated.


Kind regards

Mark Eaton
lchesnais
Top achievements
Rank 1
 answered on 26 Sep 2008
5 answers
325 views
Hi,

I have developed a WebParts page using RadDock control ( 2007 version ) and I have used RadAjaxManager ( 2007 version) to queue Ajax requests ( using SetMaxRequestQueueSize of the RadAjaxManager) for each Dock in the DockZone.

I load each user control in a specific dock ( The RadGrids used in the userControls is also the 2007 version).

Lately, I have downloaded Q2 2008 and this requires for grids to have a scriptmanager on the page.

But I can't put one on the page because it already contains a RadAjaxManager, I get a javascript error stating that Script has been initialized twice or something like that.

I know I can put the new RadAjaxManager but I will lose the SetMaxRequestQueueSize and the Mechanism won't work anymore.

The weird thing is that when there is like 4 docks on the page, it tells me that it requires a scriptmanager when there is like 6 or more the grids inside docks detected the RadAjaxmanager placed on the page and it works well.

Any Suggestions, thanks
Joseph
Top achievements
Rank 1
 answered on 26 Sep 2008
1 answer
129 views
I need to be able to add a varying number of resources that utilize varying types of controls (checkbox, dropdownlist, etc).

The problem is that I cannot create an AdvancedEdit/Insert template using an aspx page, and need to do it on the server side.

So far I can add a resource with the following...

aResource =

new ResourceType("Calendar Color");

aResource.DataSource = GetColors();  // a DataTable with 7 colors and 1 column - "Color"

aResource.KeyField =

"Color";

aResource.TextField =

"Color";

aResource.ForeignKeyField =

"RadSchedulerColor"// the field in the Scheduler datasource containing 1 of  the 7 color values

theScheduler.ResourceTypes.Add(aResource);


The problem is that I want to add new resources with different controls, like a checkbox or a radiobutton. Then I want to be able to set the value based on the Scheduler's datasource. Currently this does not link to the Scheduler so the resource has no default value. I tried to override the OnFormCreated method:

void theScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)

{

if (e.Container.Mode == SchedulerFormMode.AdvancedInsert || e.Container.Mode == SchedulerFormMode.AdvancedEdit)

{

DropDownList colors = (DropDownList)e.Container.FindControl("Calendar Color");

colors.SelectedValue =

"Red";

colors.Width =

new Unit(100, UnitType.Percentage);

}

}


This only increased the width, it doesn't set the SelectedValue. Am I doing this right? Is what I'm trying to do possible without creating a custom UserControl with aspx elements?

Peter
Telerik team
 answered on 26 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?