Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
146 views
I've been wrestling for a while trying to databind to 2 tables essentially. Custom collections that inherit from IBindingLists, but the core type of collection is not really the problem. I can succesfully bind as long as i only bind one table or collection. Things get tricky when I try to programmatically bind to the next table.

To help understand my problem I am attaching a database diagram of the tables in question.

How can I use databindings to populate data coming from that type of relations, a self-referencing table and a link-table.

I read almost everything available in the forums and online, and found nice text, but no concrete example close to this scenario.

My treeView is not using declarative datasources, I am using the OnDatabinding event to populate the grid:

<telerik:RadTreeView runat="server" ID="RadTreeView1" EnableDragAndDrop="True" OnClientMouseOver="onTreeViewMouseOver" 
        OnClientMouseOut="onTreeViewMouseOut" OnClientContextMenuItemClicking="onClientContextMenuItemClicking" 
        OnClientNodeDragStart="onTreeViewDragStart" OnDataBinding="RadTreeView1_DataBinding" 
        OnClientNodeDropping="onTreeViewDropping" OnClientContextMenuShowing="onClientContextMenuShowing" 
        OnNodeDrop="RadTreeView1_NodeDrop" OnNodeDataBound="RadTreeView1_NodeDataBound"   
        OnClientNodeDragging="onTreeViewDragging" OnNodeEdit="RadTreeView1_NodeEdit"   
        oncontextmenuitemclick="RadTreeView1_ContextClick"   
        AppendDataBoundItems="True">  
 
        <ContextMenus> 
            <telerik:RadTreeViewContextMenu ID="MainContextMenu" OnDataBinding="MainContextMenu_DataBinding" runat="server">  
                <Items> 
                    <telerik:RadMenuItem Value="Rename" Text="Rename ..." Enabled="false" ImageUrl="~/Images/rename.gif" PostBack="false"></telerik:RadMenuItem> 
                    <telerik:RadMenuItem Value="NewRootUnit" Text="New ..." ImageUrl="~/Images/newfolder.gif"></telerik:RadMenuItem> 
                    <telerik:RadMenuItem Value="Delete" Text="Delete ..." ImageUrl="~/Images/deletefolder.gif"></telerik:RadMenuItem> 
                    <telerik:RadMenuItem IsSeparator="true"></telerik:RadMenuItem> 
                    <telerik:RadMenuItem Value="SetAsDefault" Text="Set as default ..." ImageUrl="~/Images/default.png"></telerik:RadMenuItem> 
                </Items> 
                <CollapseAnimation Type="InCubic" /> 
            </telerik:RadTreeViewContextMenu> 
        </ContextMenus> 
    </telerik:RadTreeView> 

And in the NodeDataBound event I actually use custome attributes to hold all the data I need.

My problem comes when i want to hook up the UserInRegion collection of record to the Region Collection.

Thank you in advance,

Jean
Jean Cuteaux
Top achievements
Rank 1
 asked on 19 Mar 2010
1 answer
138 views
Hello!

I'm populate my RadTreeView via WCF service on demand. In service I'm set custom attribute to RadTreeNode:
Attributes = new Dictionary<string, object> { { "TypeAttribute", "Type1" } } 
Next time I'm recieve node with this attribute in WCF service (when I'm expand it), Attributes property contains this keypair: "0, {object}" instead {"TypeAttribute", "Type1"}.
When I'm debug my page in fireBug, I noticed then attributes of node in post json (from page to service) contains value of keypair as string, but response from service contains it as object. Maybe this is a source of problem?

My question is - how I must set custom attributes in WCF service code to correctly get it from "node" parameter of LoadData method of service?
Thank you.

P.S. Sorry for my bad English.
Dimitar Milushev
Telerik team
 answered on 19 Mar 2010
1 answer
203 views
I know for previous version of RadChart, we can set heightRatio=0
For recent version, there is no heightRatio property for RadChart. I checked the change and compatibility for new versions, Legend.heightRatio is changed to PlotArea].Appearance.Dimensions.Paddings (Left, Right). However, no matter what value I set to PlotArea].Appearance.Dimensions.Paddings, I still got vertical legend.

Any one knows how to do it? Thanks
Heng Du
Top achievements
Rank 1
 answered on 19 Mar 2010
2 answers
78 views
Hi ,

I have one requirement like  prevent Adding New Row while any row of the grid in Edit mode and vice verse .

1. User Can not add the new row if any row of the grid in Edit mode
2. User can not Edit any row while any blank row exist [after click on "Add New Row" ] that means without completion of Add New Row

Please help on the same ASAP .

Nitish
nitish kumar
Top achievements
Rank 1
 answered on 19 Mar 2010
1 answer
70 views
Hi,

I am working on Hierarchical RadGrid. My Grid has four level of Hierarchy. Since the columns to be rendered in Grid is not constant, all the Grid Columns are created dynamically and datasource is attched dynamically. I want to Set HierarchyLoadMode to ServerOnDemand for all levels. But on doing so it is allowing me to view only first level of Detail. On expanding the First level Master Grid collapses and hence I am not able to traverse the full hierarchy.

Also, It should allow to keep multiple columns expanded at a time for data comparison.

Regards



Pavlina
Telerik team
 answered on 19 Mar 2010
3 answers
153 views
What is the best way to get Javascript Intelliense working on the controls within an client-side event when an item is passed into the event instead of the entire RadControl?  For example, in the RadMenu's OnClientItemClicking event, the second parameter passed in has a "get_item" functioin that grabs the RadMenuItem that was clicked. Is there a way to get Intellisense working on that item?  An example would in the following snippet from the docs, where I would love to get Intellisense on the "item" variable.

Thanks,
Chris

<script type="text/javascript">  
function onClicking(sender, eventArgs)  
{  
  var item = eventArgs.get_item();  
  var navigateUrl = item.get_navigateUrl();  
  if (navigateUrl && navigateUrl != "#")  
  {  
    var proceed = confirm("Navigate to "+ navigateUrl + " ?");  
    if (!proceed)  
    {  
      eventArgs.set_cancel(true);  
    }  
    else 
    {  
      eventArgs.set_cancel(false);  
    }  
  }  
}  
</script>  
 
Dimitar Milushev
Telerik team
 answered on 19 Mar 2010
4 answers
139 views
I am using the sample Drag-n-Drop integration code and have added a resource table called "Rooms". Everything works ok until I try to drag an item from the RadGrid while the scheduler is grouped by the resources. I am am using SQLDataSources. I would assume that I need to retreive the resource id from the appointment area. Is there an example showing this functionality or could you point me in the right direction??

Thanks,

Tom 
Peter
Telerik team
 answered on 19 Mar 2010
3 answers
256 views
Hi,

I am in need of some help with filtering on my radgrid.

I have a textbox outside of the grid that alters the grid.mastertableview.filterexpression and a filter on one of the columns in the grid that also alters the filterexpression. This setup is used to combine the two "filters" into one filter.

To create the columnfilter I use the following example: http://www.telerik.com/help/aspnet-ajax/grdfilteringwithdropdownlist.html

In the Itemcommand = "Filter" I set the the mastertableview.filterexpression but when debugging the page I see that setting the filterexpession there does no difference as it seems to change again before rendering the grid.

The search-textbox works correctly by altering the filterexpression and rebinding the grid when event OnTextChanged is triggered.

The columnfilter is altering the filteringexpression on its own somewhere without telling me. ;) Does anyone have any idea where this happens? I dont see any need of attaching code as I have followed the example above almost exactly.

Thanks.
Robert Bergbrant
Top achievements
Rank 1
 answered on 19 Mar 2010
1 answer
73 views

Hi, I have the below code in Javascript & its open popup window using radopen

 

<

 

 

 

script language="Javascript">

 

 

 

 

 

var

 

radOpenWindow = window.radopen("popupwindow.aspx", "<%=preview_popup.ClientID%>");

 

radOpenWindow.add_close(OnClientClose);

radOpenWindow.show();

 

<

 

 

 

script language="Javascript">

the above code works on IE. But when i try on Firefox its load the page and close the window automatically. i.e) close while loading the page.

can you please advice solution for this issue. I want to execute some code when i close rad open window.

Thanks,
Senthil Kumar 

 

 

 

 

 

Georgi Tunev
Telerik team
 answered on 19 Mar 2010
1 answer
103 views
HI all,

    i am new to telerik controls. i am trying out sorting and filtering in radgrid. my datasource is a list of objects. databinding on pageload is working fine. for paging also similar to asp grid i wrote a server side function to rebind and it is alos working fine. but problem is with sorting and filtering. when i click on the header text the grid disappears and only a strip appears. i understand that this is the case when the grid is not binded.

i tried custom sorting method also but no progress. basic sorting functionality is enough in my case.

    i checked all the properties also. allowsorting is set to true. what else i have to do. please guide me.

Regards,
Saravanan
Pavlina
Telerik team
 answered on 19 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?