Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
168 views

The page has a panel bar which dynamically loads TreeViews as PanelItems.  To prevent losing the trees during a postback, a custom control is loaded in the XmlHttpPanel.  In order to get the correct control and pass all desired information, I need to access multiple custom attributes of the selected node.  Any suggestions on how to either pass or access the selected node server side (from within the "XmlHttpPanel_ServiceRequest" without performing a postback? 

Update to post: The trees are gone upon the service request as well and since the tree and nodes or not serializable the information cannot be stored in the viewstate either.  What was the point of making a control that loses its contents upon a postback?  Looks like the path will be to stuff everything into a long string for use as the "value" on the service call then parse out what's needed.  For such an impressive toolset overall, seems like the PanelBar is a tad lacking.  Unless of course, I missing the obvious which is always a possibility.

Below is an overly simplified view of what is being attempted.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script language="javascript" type="text/javascript">
            function NodeClicked(sender, args) {
                var node = args.get_node();
                var panel = $find("<%= RadXmlHttpPanel1.ClientID %>");
                panel.set_value(node.get_text());
            }
        </script>
    </telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <table>
        <tr>
            <td>
                <telerik:RadPanelBar ID="RadPanelBar1" runat="server">
                </telerik:RadPanelBar>
            </td>
            <td>
                <telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="XmlHttpPanel_ServiceRequest">
                </telerik:RadXmlHttpPanel>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                LoadRootContent();
        }
        private void LoadRootContent()
        {
            RadPanelItem myPanelItem = new RadPanelItem("Item 1");
            RadTreeView myTreeView = new RadTreeView();
            myTreeView.OnClientNodeClicked = "NodeClicked";
            //Build a node
            RadTreeNode node1 = new RadTreeNode("TreeNode 1");
            node1.Category = "Customers";
            node1.Attributes.Add("CustomerID", "123");
            myTreeView.Nodes.Add(node1);
            //Build another node
            RadTreeNode node2 = new RadTreeNode("TreeNode 2");
            node2.Category = "Prospects";
            node2.Attributes.Add("ProspectID", "456");
            myTreeView.Nodes.Add(node2);
  
            //Add the tree to the PanelItem - this could happen more than once for each PanelItem
            myPanelItem.Controls.Add(myTreeView);
            //Add the item to the PanelBar - this would occur for multiple items
            RadPanelBar1.Items.Add(myPanelItem);
        }
        protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
        {
            string val = e.Value;
            if (val == "TreeNode 1")
            {
                RadXmlHttpPanel1.Controls.Add(LoadControl("Test1.ascx"));
            }
            if (val == "TreeNode 2")
                RadXmlHttpPanel1.Controls.Add(LoadControl("Test2.ascx"));
  
        }
    }

Any suggestions or thoughts are welcome.
Thanks in advance.
Pero
Telerik team
 answered on 07 Dec 2010
11 answers
232 views
Hi All

I have a page which has 2 Grid on it (related tables), as follow

Grid1
ItemID     Name            Address

Grid2
employeeID       Photo       ItemID

- The Grid 2 has insert new record on it.

What i need is when insert new record on grid2 (depends on the row the user select in grid1) the ItemID get the value automatically from Grid1 and display it as label so the user does not have to enter its value... is it possible?

Thanks
Iana Tsolova
Telerik team
 answered on 07 Dec 2010
8 answers
147 views
Hi

I have a problem that I have a good idea that its caused by the Ajaxification using RadAjaxManager.

The app that Im working on has a RadTreeView and a RadScheduler. A click on a node in the tree view causes a reload of the scheduler and populate it with appoinments filtered by a filter from the tree view.

Then I want to open an appointment in the scheduler in the standard advanced edit dialog. I have a couple of resources connected to each appointment.

When I doesnt have AjaxSettings and there by reload the whole app when I update the scheduler and then open an appointment it all works fine.
But when I have an AjaxSetting between the tree view and the scheduler so that only the scheduler reloads when I click on my node and after that open an appointment in the edit dialog I get an error. The error I get is "There is not enough storage to complete this operation".
I also works fine if I remove some of the RadSplitters around the scheduler. 

Ive read a lot about that error but cannot find any connections to what Im doing.

I attach an image of the problem. And look specially on the line number. What is that!

Does anyone have any idea what this can 

//Mathias
Radoslav
Telerik team
 answered on 07 Dec 2010
3 answers
226 views
Hello,
I am using grid to display the data in a pivot manner. The intial data will be in the following format.
Apart from these columns there are many more columns from the source data.
Id  Cat/SubCatGroup TransactionDate Amount
1   Painting   10/04/2010 250
2   Music   09/27/1010 51.75
3   Music   09/27/1010 30
4   Music   09/27/1010 4

What I need to display in the grid is as shown in the  attached file  output format.png I have been trying this since long time. I am using OnNeedDataSource to bind the data.
protected void samplegrid_DataSource(object sender, EventArgs e)
{
//tr is the data (list<t> that contains the data received from the database)
//ToDataTable() is the method which converts the list of objects to datatable
   samplegrid.DataSource = GetInversedDataTable(ToDataTable(tr), "TransactionDate", "CatSubCatName",Amount", "-");
}


//In the GetInversedDataTable()-- I tried to create a datatable with data which will be in the required format

Id            Cat/SubCatGroup            09/27/2010         10/04/2010

1              Painting                                                         250

2              Music                                    51.75

3              Music                                    30          

4              Music                                    4


But here I dont want to display the Id column.
I want the amount value as a hyperlink. When I click particular amount value, I need to collect that Id value at the backend. Based on that value I have to do some action.


Could anyone please suggest me how to proceed.
Urgent pls.
thanks in advance

Radoslav
Telerik team
 answered on 07 Dec 2010
3 answers
238 views
I have just installed the ASP.NET Ajax controls with Visual Studio 2010 on Windows 7 64bit. I did a complete install from the .msi package.

When I try to create any Telerik project I am getting the error:

Template attempted to load component assembly Web.UI.VSPackage version 2010.3.1109.0. This is the version that shows in the VS2010 extension manager. I have uninstalled it and downloaded it from the online gallery, getting the same version.

In my Telerik.../Bin40 directory the Web.UI.dll file is version 2010.3.1109.40, which is probably while it is not being found. Tis version is also in the GAC.

Also, I have no Telerik Menu but I have Telerik tools in the toolbox. I have followed the steps in the documentation that are documented for this problem but no success.

Anyone have any idea?

Thank you
Juanita
Erjan Gavalji
Telerik team
 answered on 07 Dec 2010
2 answers
126 views
I looked up your example below and i am having problem reproducing it exactly like you.
I am not sure what my problem is because it looks pretty similar to your example to me.

http://www.telerik.com/help/aspnet/chart/grouping-databound-items.html

I have a list of custom objects with 3 properties (Service, Name, Quantity)
The list i get is as follow

    Name: "décembre"
    Quantite: 3
    Service: "C.I. Centre administratif "

    Name: "décembre"
    Quantite: 1
    Service: "C.I. Centre-ville"

    Name: "novembre"
    Quantite: 1
    Service: "C.I. Temporaire"

Public Sub RefreshData()
    Dim i As List(Of Intervention) = AccesDonneesHelper.GetInterventionsDetails()
    RadChart1.ChartTitle.TextBlock.Text = "MY GRAPH"
    RadChart1.Series.Add(New ChartSeries())
    RadChart1.DataSource = AddFilter()
    RadChart1.DataGroupColumn = "Service"
    RadChart1.PlotArea.XAxis.DataLabelsColumn = "Name"
    RadChart1.DataBind()
End Sub
and the output (see attached) is not what expected. There should be at least one bar in november. What am i doing wrong?
Ves
Telerik team
 answered on 07 Dec 2010
2 answers
61 views
I'm having this problem where the onGridItemSelected event is not being executed when I multi-select items using the SHIFT key.
It works just fine if I use CTRL.

Is this normal? Am I doing something wrong?

Thanks in advance.
Fiko
Telerik team
 answered on 07 Dec 2010
0 answers
132 views
We want to perform checkbox multi selection in radcombobox. We achieve multi selection functionality but comma separated text is not accepted by telerik API We tried using setText method but telerik combo box sets internally only last selected value of checkbox. Below is sample code along with Javascript functions public class RadComboCustomControl : RadComboBox { private string txtValue; protected override void PerformDataBinding(IEnumerable dataSource) { if (dataSource != null) { foreach (object dataItem in dataSource) { if (DataTextField.Length > 0) { txtValue = DataBinder.GetPropertyValue(dataItem, DataTextField, null); Items.Add(new RadCustomComboBoxItem(txtValue)); } } } } } public class RadCustomComboBoxItem : RadComboBoxItem { public RadCustomComboBoxItem(string text) : base(text) { } public RadCustomComboBoxItem() : base() { } protected override void CreateChildControls() { base.CreateChildControls(); CheckBox chkBox = new CheckBox(); chkBox.Text = this.Text; chkBox.Attributes.Add("onclick", "CheckboxClick();"); this.Controls.Add(chkBox); } } JAVA Script Code function CheckboxClick() { collectSelectedItems(); } function getItemCheckBox(item) { //Get the 'div' representing the current RadComboBox Item. var itemDiv = item.get_element(); //Get the collection of all 'input' elements in the 'div' (which are contained in the Item). var inputs = itemDiv.getElementsByTagName("input"); for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) { var input = inputs[inputIndex]; //Check the type of the current 'input' element. if (input.type == "checkbox") { return input; } } return null; } function collectSelectedItems() { var combo = $find("<%=radComboBox1.ClientID%>"); var items = combo.get_items(); var selectedItemsTexts = ""; var selectedItemsValues = ""; var itemsCount = items.get_count(); for (var itemIndex = 1; itemIndex < itemsCount; itemIndex++) { var item = items.getItem(itemIndex); var checkbox = getItemCheckBox(item); //Check whether the Item's CheckBox) is checked. if(checkbox!=null) { if (checkbox.checked) { selectedItemsTexts += item.get_text() + ", "; selectedItemsValues += item.get_value() + ", "; } } } selectedItemsTexts = selectedItemsTexts.substring(0, selectedItemsTexts.length - 2); selectedItemsValues = selectedItemsValues.substring(0, selectedItemsValues.length - 2); //Set the text of the RadComboBox with the texts of the selected Items, separated by ','. combo.set_text(selectedItemsTexts); }
ganesh g
Top achievements
Rank 1
 asked on 07 Dec 2010
3 answers
196 views
I have a master page, then i have a content page that hosts a RadTabStrip and RadMultiPage. I load some user controls inside the multipage (on demand). In one of the user controls i have a radGrid that looks fine in Firefox (http://www.telerik.com/ClientsFiles/235428_ff.jpg) and other browser but in IE it looks like on the picture below:
http://www.telerik.com/ClientsFiles/235429_ie.jpg

Is it bug or what?

The ASP.NET code looks like following:

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Windows7"
        AllowAutomaticInserts="true"
        AllowAutomaticDeletes="true"
        AllowAutomaticUpdates="true"
        AllowPaging="true"
        PageSize="10" GridLines="None"
        AutoGenerateColumns="false"
        AutoGenerateDeleteColumn="false">
     
    <MasterTableView DataKeyNames="RecordID" CommandItemDisplay="Top" PagerStyle-Position="Bottom" PagerStyle-Mode="NextPrevAndNumeric">
    <CommandItemSettings AddNewRecordText="Add new record" />
    <Columns>
       ' just a few columns here
    </Columns>
    </MasterTableView>
</telerik:RadGrid>
Dimo
Telerik team
 answered on 07 Dec 2010
1 answer
131 views
HI all,

I want to enable the multi select in the rad combobox.
I am using dataset at runtime to populate the combo box.
Please advise. Quick !!!!!


Thanks in Advance :)


Bharat Rathore
Princy
Top achievements
Rank 2
 answered on 07 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?