Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
112 views
I have a RadTreeView on a page which I have coded as follows:

<telerik:RadTreeView ID="radTreeView" runat="server" Width="100%" AutoGenerateColumns="true" OnNodeClick="radTreeView_OnNodeClick">
<
WebServiceSettings Path="BuildTrgMP.aspx" Method="GetChildNodes" />

</telerik:RadTreeView>

I have coded the GetChildNodes webservice call on the server side and this all works fine: when the user clicks a + on the tree, the little whirly appears which the webservice is called to populate the tree, which it does so correctly.
What I want to do is the opposite situation: when the user clicks a - on the tree, I want it to invalidate everything under that node such that the next time the + is clicked, the webservice is again called so that the list is updated from the database.
At the moment clicking the + just reopens the list which has previously been cached in the browser and the webservice is not called to refill the list.
How do I use OnClientNodeCollapsing (or any other approach) to invalidate the list such that pressing + causes the webservice to be called again ?

Thanks
Graham Plowman

Plamen
Telerik team
 answered on 07 Jun 2012
4 answers
113 views
Hi,
  I have used RADEditor context menu functionality. I have provided some text and right click on RADEditor control, it shows IE popup menu and my context menu in background of IE menu. It behaves like normal asp.net extbox. I dont want to display IE popup menu in the control. How to implement this functionality?
Rumen
Telerik team
 answered on 07 Jun 2012
0 answers
85 views
Dear All 

I have a Total Quantity label at RadGrid Footer.

I want to highlight and then fade out the text when the Total value changed ?!

How to do such function using Javascript ?

To understand my need, check this link, check this effect "Fade, single direction, no memory"
 

Thanks
Noha
Top achievements
Rank 1
 asked on 07 Jun 2012
5 answers
105 views
Hi,

I am using RadEditor in a UserControl, which is opening in a ModalPopup.

RadEditor is working fine on Parent Page. On ModalPopup it is throwing following error when trying to expand color toolbox. Color window is not opening at all.

this._getPopupVisibilityController() is undefined

Here's the line where error occured
this._getPopupVisibilityController().set_activePopup(this); 
Rumen
Telerik team
 answered on 07 Jun 2012
1 answer
361 views
How can I disable and change the color of a radbutton after click.
Princy
Top achievements
Rank 2
 answered on 07 Jun 2012
0 answers
159 views
   public void bindcontroltogrid(RadGrid gridtobind, RadTextBox rdtextgrid, RadComboBox rdcmbgrid,int count)
        {
            DataTable dt = new DataTable();
            List<TransactionSetupDL.TrTypeAttrDL> ob=new List<TransactionSetupDL.TrTypeAttrDL>();
         
                     int j = 0;
             ob = (List<TransactionSetupDL.TrTypeAttrDL>)HttpContext.Current.Session["lstobjTrTypeAttrdlofgrid"]; 
         
            lstvisiblelement = (List<TransactionSetupDL.TrTypeAttrDL>)HttpContext.Current.Session["lstvisiblelementofgrid"];
            //gridtobind.MasterTableView.DataSource = new string[] {"a"};
            //gridtobind.MasterTableView.TableLayout = GridTableLayout.Auto;
            //gridtobind.ClientSettings.Scrolling.AllowScroll = true;
            //gridtobind.ClientSettings.Scrolling.ScrollHeight = 100;
            //gridtobind.MasterTableView.ShowHeadersWhenNoRecords = true;
            //gridtobind.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true;
            //gridtobind.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
            //gridtobind.MasterTableView.EditMode = GridEditMode.PopUp;
            //gridtobind.MasterTableView.InsertItemDisplay = GridInsertItemDisplay.Bottom;
            //gridtobind.MasterTableView.AllowAutomaticInserts = true;
            //gridtobind.MasterTableView.AllowAutomaticDeletes = true;
            //gridtobind.AutoGenerateDeleteColumn = true;
            //gridtobind.AutoGenerateEditColumn = true;
            //gridtobind.ShowHeader = true;
            //gridtobind.MasterTableView.ShowHeader = true;
            
            //gridtobind.MasterTableView.IsItemInserted = true;
        
            //gridtobind.MasterTableView.ClientDataKeyNames = new string[] { "EmployeeID" };
            //gridtobind.AllowPaging = true;
            //gridtobind.GridLines = GridLines.Both;
            //gridtobind.AllowSorting = true;


          //  gridtobind.ClientSettings.Selecting.AllowRowSelect = true;
          //gridtobind.ClientSettings.ClientEvents.OnRowSelected="rowSelected";


          DataRow dr = dt.NewRow() ;
            Control container = new Control();
            for (int i = 0; i < lstvisiblelement.Count; i++)
            {
              
                GridTemplateColumn tc = new GridTemplateColumn();
                GridDropDownColumn ddc = new GridDropDownColumn();
              


                ControlType = (BaseBLDL.Global.controlType)lstvisiblelement[i].ControlType;
                switch (ControlType)
                {
                    case BaseBLDL.Global.controlType.bpTxtControl:




                     //   tc.HeaderTemplate = new AddTemplateToGridView(ListItemType.Header, lstvisiblelement[i].NameStr, ControlType, lstvisiblelement[i].DefaultVal, lstvisiblelement[i].AttrDefId, ob[i].Editable, rdcmbgrid, rdtextgrid);


                     //   tc.ItemTemplate = new AddTemplateToGridView(ListItemType.Item, lstvisiblelement[i].NameStr, ControlType, lstvisiblelement[i].DefaultVal, lstvisiblelement[i].AttrDefId, lstvisiblelement[i].Editable, rdcmbgrid, rdtextgrid);


                        //tc.UniqueName = lstvisiblelement[i].NameStr;
                    //    tc.HeaderTemplate.InstantiateIn(container);
                       
                    //    tc.ItemTemplate.InstantiateIn(container);


                        //dt.Columns.Add(lstvisiblelement[i].Label);
                   


                         // dr[lstvisiblelement[i].Label] =tc;


                        //dt.Rows.Add(dr);


                        //gridtobind.MasterTableView.Columns.Add(tc);


                        //tc.UniqueName = lstvisiblelement[i].Label;
                       // gridtobind.MasterTableView.Columns.AddAt(j, tc);
                    //    gridtobind.MasterTableView.Columns[j].HeaderText = lstvisiblelement[i].NameStr;
                      //  gridtobind.MasterTableView.Columns[j].UniqueName = lstvisiblelement[i].NameStr;
                        
                            dt.Columns.Add(lstvisiblelement[i].Label).Namespace = Convert.ToString(lstvisiblelement[i].AttrDefId);
                        
                        //gridtobind.MasterTableView.Columns[j].HeaderStyle.Width = lstvisiblelement[i].ColWidth;
                        
                        break;
                    case BaseBLDL.Global.controlType.bpCmbControl:








                    //    tc.HeaderTemplate = new AddTemplateToGridView(ListItemType.Header, lstvisiblelement[i].NameStr, ControlType, lstvisiblelement[i].DefaultVal, lstvisiblelement[i].AttrDefId, lstvisiblelement[i].Editable, rdcmbgrid, rdtextgrid);


                       // tc.ItemTemplate = new AddTemplateToGridView(ListItemType.Item, lstvisiblelement[i].NameStr, ControlType, lstvisiblelement[i].DefaultVal, lstvisiblelement[i].AttrDefId, lstvisiblelement[i].Editable, rdcmbgrid, rdtextgrid);
                      


                        //Control containercmb = new Control();
                        //tc.UniqueName = lstvisiblelement[i].NameStr;
                      //  tc.HeaderTemplate.InstantiateIn(containercmb);
                     //   tc.ItemTemplate.InstantiateIn(containercmb);
                        
                


                        //dt.Columns.Add(lstvisiblelement[i].Label);


                        //dr[lstvisiblelement[i].Label] = tc;


                        //dt.Rows.Add(dr);






                        //tc.UniqueName = lstvisiblelement[i].Label;
                       // gridtobind.MasterTableView.Columns.AddAt(j , tc);
                       
                        //gridtobind.MasterTableView.Columns[j].HeaderText = lstvisiblelement[i].NameStr;
                        //gridtobind.MasterTableView.Columns[j].UniqueName = lstvisiblelement[i].NameStr;
                        //if (lstvisiblelement[i].Label != "Item")
                        //{
                        if (lstvisiblelement[i].Label!="Item")
                        {
                            dt.Columns.Add(lstvisiblelement[i].Label).Namespace = Convert.ToString(lstvisiblelement[i].AttrDefId);
                        }
                        else
                        {
                        tc.HeaderTemplate = new AddTemplateToGridView(ListItemType.Header, lstvisiblelement[i].NameStr, ControlType, lstvisiblelement[i].DefaultVal, lstvisiblelement[i].AttrDefId, lstvisiblelement[i].Editable, rdcmbgrid, rdtextgrid);
                        
                        tc.ItemTemplate = new AddTemplateToGridView(ListItemType.Item, lstvisiblelement[i].NameStr, ControlType, lstvisiblelement[i].DefaultVal, lstvisiblelement[i].AttrDefId, lstvisiblelement[i].Editable, rdcmbgrid, rdtextgrid);
                        Control containercmb = new Control();
                        tc.UniqueName = lstvisiblelement[i].Label;
                        tc.HeaderText = lstvisiblelement[i].Label;
                        tc.EditItemTemplate = new AddTemplateToGridView(ListItemType.EditItem, lstvisiblelement[i].NameStr, ControlType, lstvisiblelement[i].DefaultVal, lstvisiblelement[i].AttrDefId, lstvisiblelement[i].Editable, rdcmbgrid, rdtextgrid);
                        tc.EditItemTemplate.InstantiateIn(containercmb);




                        tc.ItemTemplate.InstantiateIn(containercmb);
                        gridtobind.MasterTableView.Columns.Add(tc);
                       
                     //   gridtobind.MasterTableView.Columns.AddAt(3, tc);
                        }
                        //}
                        //gridtobind.MasterTableView.Columns[j].ItemStyle.Width = lstvisiblelement[i].ColWidth;
                        
                        break;


                }
                j++;


            }
            //for (int i = 0; i <= count; i++)
            //{
            // 
            //    dr = dt.NewRow();
            //}
           
            HttpContext.Current.Session["datatable"] = dt;
            HttpContext.Current.Session["lsttrtypeattr"] = lstvisiblelement;
            gridtobind.MasterTableView.DataSource = dt;
         
        }


        public class AddTemplateToGridView : ITemplate
        {
            ListItemType _type;
            string _colName;
            string _DefaultVal;
            int _AttrDefId;
            bool _Editable;
            string _columnName;
            ListItemType _templateType;


            BaseBLDL.Global.controlType _controltype;
            RadComboBox _cmboxgrid;
            RadTextBox _rdtextbox;
            //ListItemType type, string colname,
            public AddTemplateToGridView(ListItemType type, string colname,BaseBLDL.Global.controlType controltype, string DefaultVal, int AttrDefId, bool Editable, RadComboBox cmboxgrid, RadTextBox rdtextbox)
            {
                //_type = type;


                //_colName = colname;
                _controltype = controltype;
                _DefaultVal = DefaultVal;
                _AttrDefId = AttrDefId;
                _Editable = Editable;
                _cmboxgrid = cmboxgrid;
                _rdtextbox = rdtextbox;
                _templateType = type;


              
                _columnName = colname;
            }
            void ITemplate.InstantiateIn(System.Web.UI.Control container)
            {
                switch (_templateType)
                {
                    case ListItemType.Header:
                        //Creates a new label control and add it to the container.
                        Label lbl = new Label();            //Allocates the new label object.
                        lbl.Text = _columnName;             //Assigns the name of the column in the lable.
                        container.Controls.Add(lbl);        //Adds the newly created label control to the container.
                        break;
                }


                switch (_templateType)
                {
                    case ListItemType.Item:


                        switch (_controltype)
                        {


                            case BaseBLDL.Global.controlType.bpTxtControl:


                                if (_AttrDefId == 13)
                                {
                                    Label lb = new Label();
                                    lb.Text = "1";
                                    lb.ID = _columnName;
                                   
                                    lb.ClientIDMode = ClientIDMode.Static;
                                    container.Controls.Add(lb);
                                }
                                else
                                {
                                    _rdtextbox = new RadTextBox();
                                    _rdtextbox.ID = _columnName;
                                    _rdtextbox.Text = _DefaultVal;
                                    _rdtextbox.Enabled = _Editable;
                                    _rdtextbox.ClientIDMode = ClientIDMode.Static;
                                    container.Controls.Add(_rdtextbox);
                                }
                                break;


                            case BaseBLDL.Global.controlType.bpCmbControl:
                                if (_AttrDefId == 17)
                                {
                                    _rdtextbox = new RadTextBox();
                                    _rdtextbox.ID = _columnName;
                                    _rdtextbox.ClientIDMode = ClientIDMode.Static;
                                    _rdtextbox.Text = _DefaultVal;
                                    _rdtextbox.ClientIDMode = ClientIDMode.Static;
                                    container.Controls.Add(_rdtextbox);
                                }
                                else
                                {
                                    _cmboxgrid = new RadComboBox();
                                    _cmboxgrid.ID = "Item";
                                    _cmboxgrid.Items.Add(new RadComboBoxItem("hello"));
                                    //_cmboxgrid.Items.Add(new RadComboBoxItem("Select Item"));
                                    _cmboxgrid.DataBinding += new EventHandler(_cmboxgrid_DataBinding);
                                    container.Controls.Add(_cmboxgrid);
                                }
                                break;
                        }
                        break;
                }
            }


            void _cmboxgrid_DataBinding(object sender, EventArgs e)
            {
                 RadComboBox lb = (RadComboBox)sender;
                 GridViewRow container = (GridViewRow)lb.NamingContainer;
                 if (container.DataItem is DataRowView)
                 {
                     DataRowView dvr = container.DataItem as DataRowView;
                     if (DataBinder.Eval(container.DataItem, "Item", "{0:N0}").ToString() != "")
                         lb.Text = DataBinder.Eval(container.DataItem, "Item", "{0:N0}").ToString();
                     else
                         lb.Text = "lb";
                 }
            }








            void txt_DataBinding(object sender, EventArgs e)
            {


                //    RadComboBox lnk = (RadComboBox)sender;
                //    GridViewRow container = (GridViewRow)lnk.NamingContainer;
                //    object dataValue = DataBinder.Eval(container.DataItem, _colName);
                //    if (dataValue != DBNull.Value)
                //    {
                //        lnk.Text = dataValue.ToString();
                //        lnk.EmptyMessage = "asddas";
                //        lnk.Text = "sdfsdf";
                //    }


            }




        }



protected void cmbTrNo_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            List<TransactionSetupDL.TrTypeAttrDL> lsttrtypeattrvisibletogrid = (List<TransactionSetupDL.TrTypeAttrDL>)Session["lsttrtypeattr"];
            DataTable dt = (DataTable)Session["datatable"];
            dt.Rows.Clear();
           string query= objbpTrGrid.createSelectQry(Convert.ToInt32(cmbTrNo.SelectedValue), false, false);
           DataTable dtgentr = objgentrdetbl.GetDataTable(query);
           //DataTable dt = (DataTable)Session["datatable"];
           //dt.Rows[0].Delete();
        // ArrayList  arrylstgentr= objgentrdetbl.Select(objbpTrGrid.createSelectQry(Convert.ToInt32(cmbTrNo.SelectedValue), false, false));
           if (Session["dt"] == null)
           {
            
               for (int i = 0; i < dtgentr.Rows.Count; i++)
               {
                   DataRow dr = dt.NewRow();
                   dt.Rows.InsertAt(dr, i);
                  
                   for (int j = 0; j < dt.Columns.Count; j++)
                   {
                  
                       //DataColumn col = dtgentr.Columns[dt.Columns[j].ColumnName];
                       for (int k = 0; k < lsttrtypeattrvisibletogrid.Count; k++)
                       {
                           
                       
                       if (Convert.ToString(lsttrtypeattrvisibletogrid[k].AttrDefId) == dt.Columns[j].Namespace)
                       { 
                       
                       DataColumn col = dtgentr.Columns[lsttrtypeattrvisibletogrid[k].NameStr];
                       if (col != null)
                       {
                         
                           dt.Rows[i][dt.Columns[j].ColumnName] = dtgentr.Rows[i][col].ToString();
                             
                      
    




                       }
}


                       }


                   }
               }
           }
            else
           {


                dt = (DataTable)Session["dt"];
               dt.Rows.Clear();
               for (int i = 0; i < dtgentr.Rows.Count; i++)
               {
                   DataRow dr = dt.NewRow();
                   dt.Rows.InsertAt(dr, i);
                   for (int j = 0; j < dt.Columns.Count; j++)
                   {
                       for (int k = 0; k < lsttrtypeattrvisibletogrid.Count; k++)
                       {
                           if (Convert.ToString(lsttrtypeattrvisibletogrid[k].AttrDefId) == dt.Columns[j].Namespace)
                           {


                               DataColumn col = dtgentr.Columns[lsttrtypeattrvisibletogrid[k].NameStr];
                               if (col != null)
                               {


                                   dt.Rows[i][j] = dtgentr.Rows[i][col].ToString();
                               }
                           }
                       }
                   }
               }
            
           }
       
           Session["datatable"] = dt;
            
            RadGrid1.Rebind();
            Session["dt"] = dt;
        }


        protected void RadGrid1_DataBinding(object sender, EventArgs e)
        {
            DataTable t = (DataTable)Session["datatable"];
        if (t != null)
        {
            for (int i = 0; i < t.Rows.Count; i++)
            {
                RadGrid1.EditIndexes.Add(i);
              
            }
          
          
        }
     
    
          
        }
Muhammad
Top achievements
Rank 1
 asked on 07 Jun 2012
6 answers
139 views
Hi

Is there anyway of rendering the xml representation of a treeview using javascript? maybe using json/jayrock?

The xml can be obtained when a node is expanding however as the trewview isn't set to serverside the collapse node event is not fired. Is thereanyway around this? Need to store the state of the treeview which works fine when a user expands a node but when they collapse a node the change can not be captured

Any help much appreciated? It is not viable to put the treeview in an updatepanel

Thanks
Kieran
Plamen
Telerik team
 answered on 07 Jun 2012
1 answer
195 views
I have a radcombobox with checkboxes. I need to change the color of the selected items of the combobox on selecting a radio button.
Princy
Top achievements
Rank 2
 answered on 07 Jun 2012
0 answers
103 views
how i should specify the limit of adding child items in my parent on RadTreeList .. please help me.. urgent so...
Prassin
Top achievements
Rank 1
 asked on 07 Jun 2012
8 answers
106 views
Hi, 

When using Chrome, appointments seems to get some offset problems after using the browser scrollbars. This makes moving and resizing appointments impossible after a while.

It can be achieved in your demo (http://demos.telerik.com/aspnet-ajax/scheduler/examples/outlook2007/defaultcs.aspx) by:
1. Scroll as far down you can, with the browser scrollbar, on this page without losing the "Product planning"-appointment out of sight.
2. Move the "Product planning"-appointment to 4pm.
3. Scroll all the way up again.
4. Try to move or resize any appointment in the demo.

This is tested with the latest version of Chrome.

Best regards,
Daniel
Peter
Telerik team
 answered on 07 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?