Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
115 views
Hi all,

I'm implementing a user control which uses a radtreeview as filter, I need to have access to the checkbox element of each radtreenode in order to attach an onclick=Function(param1,param2..). The "OnClientNodeChecked" event does not work for me because the user control has several other controls inside, which makes obtaining clientId's a bit tricky...I tried making a template with the checkboxes for the radTreeView, but that makes useless a lot of the javascript that handles checkbox behavior (like the get_checked()).

A bit like going through a client select column in a grid...and doing something with the check...

Thanks in advance.
Plamen
Telerik team
 answered on 10 Oct 2011
1 answer
128 views
I have a RadTreeView and a RadScheduler. When I drag and drop items from the TreeView into the scheduler, i want an appointment inserted. I do not use a datasource for the Scheduler, and what I do here is on the RadTreeView.OnNodeDropping i have the following JavaScript:

 

 

function nodeDropping(sender, eventArgs) {

 

 

 

var node = eventArgs.get_sourceNode();

 

 

 

var args = node.get_value();

 

 

__doPostBack(

 

'ctl00$ContentPlaceHolder1$upTest', args);
}

Then in the page load, I catch these arguments and insert an appointment.
My problem is: how to get the date and time of the Scheduler? Meaning the spot I dropped my item on. I have searched the documentation, but I can not find a list of the functions like get_sourceNode() etc that I can use. I can use

 

eventArgs.get_htmlElement() to get a referance to the element where I dropped the item (the Scheduler), but how to get the exact position I dropped it into?

Plamen
Telerik team
 answered on 10 Oct 2011
3 answers
100 views
Hi. I am about to start using the scheduler. I have a rather complex situation and need to provide a lot of control and functionality from code behind.

I may have missed some capability but it would be useful (as a suggestion for future consideration) to have a "read only" property for appointments. I realise that there is a property for the scheduler but I have a situation where the user can view not only their appointments but also other users' appointments. I could easily set "read only" in the data source (table.userId == myId) but unless I've missed something don't see any capability that supports this.

My application is a little complex. I cannot therefore predefine a simple datasource and the code behind will have to create and bind the datasource (which I can easily do). However, that means (again unless I've missed some trick or capability) that the scheduler will not have queries for insert, delete and update. Can anyone provide a link to a simple tutorial/example of how to control these events in code behind.

In my application delete, insert and update are also complicated by the functionality being dependant on the data itself (ie whether the related appointment is the user's appointment or someone else's). Thus my code behind has to really control the whole process and probably the easiest thing is to display custom templates or user controls for the job. Again any link to simple examples would be appreciated and also just confirmation of how to override or cancel the default scheduler behaviour would be appreciated.

Thanks

PS in the documentation about the appointment class I noticed some information about "categories". If anyone can provide a link for further information about how to use them I'd appreciate it.
Plamen
Telerik team
 answered on 10 Oct 2011
3 answers
150 views

HI,
  I'm trying to implement a treeview in a combobox. the treeview uses WEBService mode for loadondemand. It is required that the treeview would be initialized whenever the user close and reopen the dropdown of the combobox, since the user may have checked some checkboxes and expand a few tree nodes, so the treeview has to be returned to the initial state. I tried looking up documents, demos and example for a treeview client method that could result in a  reloading of the treeview data items, nor could I find a client method from either treeview or combobox that could fire an event on the server side that I could reload the treeview from server side. Of cause there is the Ajaxrequest that could relay to the server side, but this is another problem. I tried to implement the ajaxrequest in the OnClientDropdownOpened and  OnClientDropdownOpening event and run the webservice data load function on server side. but the dropdown opened with an empty treeview (a blank area the side of the treeview). I actually encountered same delima in previouse attemps to use ajaxrequest for tooltip and rotator, grid etc. I tried avoid using ajaxrequest because I luckily found the OnItemCommand event that meets the trigger in client and fire on server criteria.   Could you advice if that is any way to reload treeview data triggered from client.
I would appreciate it very much if you could explain the problems with ajaxrequest and how to use it correctly.
Thank you very much!




<head runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
       <script type="text/javascript">
           var arItems = new Array();
           function shownText() {
               if (arItems.length == 0)
                   return "";
               var text = "";
               var cnt = 0;
               for (i = 0; i < arItems.length; i++)
                   if (arItems[i].code != "-") {
                       if (cnt > 0)
                           text += "+";
                       text += arItems[i].text;
                       cnt++;
                   }
               return text;
 
           }
           function treeNodeChecked_handler(sender, args) {
 
               var comboBox = $find("<%= cmbClass.ClientID %>");
               var node = args.get_node()
 
 
               if (args.get_node().get_checked()) {
                   var item = new Object();
                   var code = node.get_value().split('|');
                   item.code = code[1];
                   item.text = node.get_text();
                   arItems[arItems.length] = item;
               }
               else {
                   var txt = node.get_text();
                   for (i=0; i<arItems.length; i++) {
                       if (arItems[i].text == txt) {
                           arItems[i].code = "-";
                           arItems[i].text = "-";
                           break;
                       }
                   }
               }
               var showtext = shownText();
               comboBox.set_text(showtext);
 //              comboBox.trackChanges();
 //              comboBox.get_items().getItem(0).set_text(showtext);
 //              comboBox.commitChanges();
 
 //              comboBox.hideDropDown();
 
               // Call comboBox.attachDropDown if:
               // 1) The RadComboBox is inside an AJAX panel.
               // 2) The RadTreeView has a server-side event handler for the NodeClick event, i.e. it initiates a postback when clicking on a Node.
               // Otherwise the AJAX postback becomes a normal postback regardless of the outer AJAX panel.
 
 //              comboBox.attachDropDown();
 
           }
           function StopPropagation(e) {
               if (!e) {
                   e = window.event;
               }
 
               e.cancelBubble = true;
           }
 
           function dropdownOpened_handler(sender, eventArgs) {
               var ajaxManager = $find("<%= cmbAjaxManager.ClientID %>");
               ajaxManager.ajaxRequest("");
 
           }
        </script>
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
     
        <telerik:RadComboBox ID="cmbClass" Runat="server" Skin="Windows7"
            DropDownWidth="500px"
            Height="300px" Width="250px" AutoPostBack="true" onload="cmbClass_Load" 
            ontextchanged="cmbClass_TextChanged"  >
           <ItemTemplate>
              <div id="div_tv">
                <telerik:RadTreeView ID="tvClass" runat="server" Height="400px" Width="500px"  OnClientNodeChecked="treeNodeChecked_handler"
                      Skin="Windows7" CheckBoxes="True" CheckChildNodes="True">
                    <WebServiceSettings Path="CategoryComboBox.aspx" Method="GetClassItems" />
                </telerik:RadTreeView>
              </div>
            </ItemTemplate>
            <Items>       
                <telerik:RadComboBoxItem Text="" />   
            </Items>
        </telerik:RadComboBox>
     
    </div>
    <telerik:RadAjaxManager runat="server" id="cmbAjaxManager" >
    </telerik:RadAjaxManager>
    </form>
</body>
I CAN LOAD THE TREEVIEW IN ONLOAD EVENT CORRECTLY      
 protected void cmbClass_Load(object sender, EventArgs e)
        {
            RadTreeView tv = cmbClass.Items[0].FindControl("tvClass") as RadTreeView;
            LoadRootNodes(tv, TreeNodeExpandMode.WebService);
 
        }
USING AJAXREQUEST FAILED TO DISPLAY THE TREEVIEW CORRECTLY
        protected void cmbAjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            RadTreeView tv = cmbClass.Items[0].FindControl("tvClass") as RadTreeView;
            LoadRootNodes(tv, TreeNodeExpandMode.WebService);
        }

 

Ivana
Telerik team
 answered on 10 Oct 2011
2 answers
122 views
My paged radgrid (client-side bound) has a small problem:  When I reach the last page, there are fewer than <PageSize> rows in it, which causes the grid to get shorter. This is inconvenient because you have to move your mouse up the page a bit to reach the paging controls.  Is there a way to keep the last page from rolling up?  I just want to keep my paging controls from jumping all over the screen.

This behavior can be seen in the "numeric pager" example on this demo: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/paging/defaultcs.aspx

Phil
Phil Hadley
Top achievements
Rank 1
 answered on 10 Oct 2011
1 answer
223 views
Hi guys,

I'm trying to implement Metro theme from this page:
http://www.telerik.com/support/skins/details/metro-skin-for-asp-net-ajax.aspx

I downloaded it added as a theme

MetroInVisualStudio.png

And registered in web config with those AppSettings

 
<appSettings>
  <add key="Telerik.EnableEmbeddedSkins" value="false" />
  <add key="Telerik.EnableEmbeddedBaseStylesheet" value="false" />
  <add key="Telerik.Skin" value="Metro" />   
</appSettings>


And get this result : metroresult.png

What I need to do more? Thanks

Bozhidar
Telerik team
 answered on 10 Oct 2011
0 answers
45 views

Hi,

In our product we are using entity framework validation. But these valdiations are performing from server side. I just want to make sure which one is better, asp.net server side validations or Entity framework validations.

We are using telerik controsl.

Could some one please help me regarding this

Thanks in advance
prathyusha
Top achievements
Rank 1
 asked on 10 Oct 2011
1 answer
60 views


telerik:RadDatePicker . should clear the that text box value ,
how i restrict that


Thanks,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 10 Oct 2011
4 answers
159 views
I have a RadioButtonList that gets its elements via a SqlDataSource
<asp:RadioButtonList ID="rblRadioButtons" runat="server" AutoPostBack="True" DataSourceID="ComboBoxDataSource"
    DataTextField="Name" DataValueField="ID" RepeatColumns="4" RepeatDirection="Horizontal">
</asp:RadioButtonList>

When I try to make on of the elements selected by default in the Page_Load (e.g. rblRadioButtons.SelectedValue = "2")

The bound RadComboBox in my insert/edit form (EditFormType="WebUserControl") doesn't change it's selection whenever the selected value = 2.
<telerik:RadComboBox ID="MealID" SelectedValue='<%# Bind("ID") %>' runat="server"
      DataSourceID="ComboBoxDataSource" DataTextField="Name" DataValueField="ID">
</telerik:RadComboBox>

So if the elements returned by ComboBoxDataSource are:

Name        ID
One           1
Two           2
Three        3
Four          4 

...when the RadioButtonList has a selected value of 2, the RadComboBox should show "Two" but it doesn't. However, if you select 1, 3, or 4, the radComboBox shows the right entry of "One, "Three", and "Four" respectively.

Also, I want to note, that if I comment out the RadAjaxManager, it works fine for all elements 1, 2, 3 and 4.

I hope this made sense and thanks for the help.
Chris
Top achievements
Rank 1
 answered on 10 Oct 2011
4 answers
168 views
Hi Telerik Team,

I have a RadGrid requirement that needs "InPlace" Editmode in which there need to be two dropdown columns one depends on other dropdown selection...

so i have seen a example in your site 

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/validation/defaultcs.aspx

in this example when "Adding new Record" can i load data in second "Dropdownlist" depending on the first "Dropdownlist" selected value.
If so what is the best template column i can use to have an access on Dropdownlists.

Can u please guide me with correct approach how to obtain this requirement.

Its urgent...Please do respond

Thanks in Advance
Pavlina
Telerik team
 answered on 10 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?