Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
95 views
Hello

I have a little problem with selectedValue,

If a dataValueField contain space , i don't get the selectedvalue.


this.PCB.Items.Add(new Telerik.Web.UI.RadComboBoxItem("LOCATION","L ");
this.PCB.Items.Add(new Telerik.Web.UI.RadComboBoxItem("VENTE","V ");
this.PCB.Items.Add(new Telerik.Web.UI.RadComboBoxItem("LOCATION MEUBLE","LM");
this.PCB.Items.Add(new Telerik.Web.UI.RadComboBoxItem("VENTE COMMERCE","VC");

If choose

this.PCB_TYPE_TRANS.SelectedValue="LM";  it's works
this.PCB_TYPE_TRANS.SelectedValue="L"; or this.PCB_TYPE_TRANS.SelectedValue="L ";  it's doesn"t work

i have a space cause i add the item from database with telerik dataaccess and datasource.


thanks for your help
Olivier,






Olivier
Top achievements
Rank 2
 answered on 03 Feb 2015
4 answers
174 views
Hi, I am using the ExcelML export format and there are a few issues that I am encountering and looking for help to resolve.

1. While exporting in the ExcelMLExportRowCreated event handler, I am trying to add indentation to a cell text by adding spaces but my spaces are being trimmed. How can I add a tab or spaces in front of the cell text?

2. I don't see a way to hide the workbook gridlines. If there is not a way, I could manipulate the XML before it renders and add <DoNotDisplayGridlines/> to the WorksheetOptions node. Where/how, can I manipulate the XML output?

3. Is there a way to autosize the columns or execute a script to do it on open or calculate the correct size after the worksheet is built and adjust the size of the columns?

Thanks for your help.
 
Kostadin
Telerik team
 answered on 03 Feb 2015
1 answer
720 views
I am attempting to create a web form with a RadPivotGrid and RadChart according to http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/applicationscenarios/chartintegration/defaultvb.aspx?show-source=true

However, I am getting the following error when I run the project:
JavaScript runtime error: Unable to get property 'PageRequestManager' of undefined or null reference

Can you kindly advise?
Radoslav
Telerik team
 answered on 03 Feb 2015
1 answer
48 views
Hi, how do you set he style for the edit form field titles (to the left of the input controls). I have a CSS class that I would like to apply to the table cells that hold the titles, but cannot see how to do this.

I have attached a screen shot of the area that I mean.

thanks

Eyup
Telerik team
 answered on 03 Feb 2015
1 answer
60 views
Hi,

The Site structure as below
1. www.root.org
2. www.root.org/subsite
3. www.root.org/subsite/Audience etc. 
                
We have a requirement to customize the CSS Class Layout dropdown for “Publishing Page Content (content field)” and Telerik RadEditor for SharePoint Web Part.
This customization should work for media kit site level and its sub sites level (www.root.org/subsite   & www.root.org/subsite/Audience).
We followed the instruction as in http://www.telerik.com/help/aspnet-ajax/moss-sp2010-different-configuration-files-for-different-webs.html and media kit site is picking the custom style sheet in the dropdown under Table Wizard  Table Properties  CSS Class Layout. 
However the sub sites www.root.org/subsite/Audience are not picking the custom styles. They are displaying some default value as in the screenshot attached (Telerik_Table_CSS_Class_Layout_Issue.png). 

If we make some customization in some site level, will it be inherited to its sub site?

Ianko
Telerik team
 answered on 03 Feb 2015
19 answers
418 views
I've followed the  tutorials and examples to save the Grid settings by user. I"m using the  GridSettingsPersister.cs class. Everything is working fine using the SessionState.  I have a requirement that a user should be able to save multiple settings and reload them as needed for a report.  Basically saving the report search criteria and display, so when the user comes back in the future they can select a saved report settings name from a combobox and the report will return results in the saved format.  I'm using a Sql Server table to save my named search and display criteria.  I'm having trouble getting the saved grid format to load.  It seems to be saving fine but when I get the value from the combobox_selectedIndex change event (autopostback=true).  The saved settings for the grid aren't applied.
I've followed this example: http://www.telerik.com/help/aspnet-ajax/grdsavingsettingsonperuserbasis.html but I'm missing something when restoring from the database.  What do I need to do to get this work properly?

Aspx:
                <telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="Select Report Setting" LoadingMessage="Loading..." AutoPostBack="true" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" Skin="Outlook" Width="250px" ></telerik:RadComboBox> 
                &nbsp;<telerik:RadTextBox ID="RadTextBox1" runat="server"  Skin="Outlook"></telerik:RadTextBox>&nbsp;  
                <asp:Button ID="btnSaveSettings" runat="server" Text="Save Setttings" CommandName="SaveProfile" OnClick="btnSaveSettings_Click" /> 
            </td>   
        </tr>               
        <tr valign="top">    
            <td><img src="images/spacer.gif" width="15px" alt=""  /></td>             
            <td style="height:600px;">  
                <telerik:RadGrid ID="ARGrid" runat="server" Width="95%" GridLines="None" 
                    AutoGenerateColumns="False" PageSize="13" AllowSorting="True" AllowPaging="True" 
                    OnNeedDataSource="ARGrid_NeedDataSource" ShowStatusBar="true" ShowGroupPanel="true" Skin="Outlook" > 
                    <MasterTableView DataKeyNames="Userreportid" AllowFilteringByColumn="true" AllowMultiColumnSorting="true" Width="100%" CommandItemDisplay="None" EditMode="InPlace" > 
                        <Columns> 
                            <telerik:GridBoundColumn UniqueName="Userid" SortExpression="Userid" HeaderText="Userid" DataField="Userid"/>  
                            <telerik:GridBoundColumn UniqueName="Fields" SortExpression="Fields" HeaderText="Fields" DataField="Fields"/>                              
                            <telerik:GridBoundColumn UniqueName="Grouping" SortExpression="Grouping" HeaderText="Grouping" DataField="Grouping"/>  
                            <telerik:GridBoundColumn UniqueName="Sorting" SortExpression="Sorting" HeaderText="Sorting" DataField="Sorting"/>   
                            <telerik:GridBoundColumn UniqueName="Filtering" SortExpression="Filtering" HeaderText="Filtering" DataField="Filtering"/>                                                                                       
                        </Columns> 
                    </MasterTableView> 
                    <ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" ColumnsReorderMethod="Reorder" > 
                    </ClientSettings> 
                     <GroupingSettings ShowUnGroupButton="true"  /> 
                </telerik:RadGrid> 

Code Behind:
       protected string SettingsState  
        {  
            get { return (string)Session["_settingsar"] ?? string.Empty; }  
            set { Session["_settingsar"] = value; }  
        }  
 
        protected void Page_Init(object sender, EventArgs e)  
        {  
            if (SettingsState != string.Empty)  
            {  
                GridSettingsPersister persister = new GridSettingsPersister(ARGrid);  
                persister.LoadSettings(SettingsState);  
            }  
        }  
 
       protected void Page_PreRender(object sender, EventArgs e)  
        {  
            GridSettingsPersister persister = new GridSettingsPersister(ARGrid);  
            SettingsState = persister.SaveSettings();  
        }  
 
 
        protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)  
        {  
            if (RadComboBox1.SelectedItem != null)  
            {  
                List<UserReport> ursettings = UserReport.getByUserid(Master.loggedUser.Userid);  
                foreach (UserReport ur in ursettings)  
                {  
                    if (ur.Fields == RadComboBox1.SelectedItem.Text)  //property for grid settings  
                    {  
                        SettingsState = ur.Filtering;  //set sesssion var for the grid settings  
                    }  
                }  
            }  
        } 

 

protected void btnSaveSettings_Click(Object sender, EventArgs e)

 

{

 

string settingname = RadTextBox1.Text;

 

 

 

if (RadTextBox1.Text != string.Empty)

 

{

 

string grsettings = string.Empty;

 

 

GridSettingsPersister persister = new GridSettingsPersister(ARGrid);

 

grsettings = persister.SaveSettings();

 

UserReport ursettings = new UserReport();

 

ursettings.Userid = Master.loggedUser.Userid;

ursettings.Fields = RadTextBox1.Text;

ursettings.Filtering = grsettings;

ursettings.Grouping=

"group stuff";

 

ursettings.save();

BindSavedSettings();

}

 

}




SIMPLE
Top achievements
Rank 1
 answered on 03 Feb 2015
2 answers
132 views
When a file gets uploaded to the temporary folder its name is changed to ensure that it is unique. However the file gets copied to the TargetFolder with its original name. If two people upload files with the same name at the same time then the latter will overwrite the former. How can I ensure that each file in the TargetFolder will be unique so as to prevent collisions?
Mike
Top achievements
Rank 1
 answered on 02 Feb 2015
2 answers
464 views
Hi,

I am dynamically adding menu items and submenu items to RadContextMenu. I have a Radgrid, on right click it shows contextmenu. Items in context menu are dynamically added based on row clicked.

This context menu renders fine most of the time but one in a while item width do not cover 100% and shows transparent background. How can I fix this issue?

JavaScript code to add context menu items:
............................................................................
function GetInformationFromServerAndCreateTicketBayContextMenuItems(sender, eventArgs) {
            var cmTechFilterID = $telerik.$("[id$='cmTechFilter']").attr("id"); //Gets the ID, this is external JS safe...you can use the = .ClientID asp method though
            var menu = $find(cmTechFilterID);
           // menu.trackChanges();
            menu.get_items().clear();
           // menu.commitChanges();


            var evt = eventArgs.get_domEvent();
            if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
                return;
            }

            //this prevents from displaying browser context menu
            var evt = eventArgs.get_domEvent();
         
           evt.cancelBubble = true;
           var index = eventArgs.get_itemIndexHierarchical();
           document.getElementById("radGridClickedRowIndexCM").value = index;
           sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);

          

           var rgTicketsGridID = $telerik.$("[id$='rgTicketsGrid']").attr("id"); //Gets the ID, this is external JS safe...you can use the = .ClientID asp method though
           var grid = $find(rgTicketsGridID);

           var dataItem1 = grid.get_masterTableView().get_dataItems()[index];
           var currentTicketID = dataItem1.getDataKeyValue("ID");
           var apptID1 = dataItem1.getDataKeyValue("ApptID");
           var Status = dataItem1.getDataKeyValue("Status");

           var baseUrl = 'WorkforceServices/RequestHandler.ashx?q=getticketbaycontextmenuitems&TicketID=' + currentTicketID + "&ApptID=" + apptID1;
           var serviceOptions = {};
           serviceOptions.url = baseUrl;
           serviceOptions.data = null;
           serviceOptions.type = 'GET';
           serviceOptions.processData = false;
           serviceOptions.contentType = "application/json";
           serviceOptions.dataType = 'json';
           serviceOptions.success = function (result) {

               menu.trackChanges();
               menu.get_items().clear();

               var ticketBayContextMenuItems = result.TicketBayContextMenus;
                       var ticketStatuses = result.TicketStatuses;
                       var bumpStatuses = result.BumpStatuses ;

                       if (ticketBayContextMenuItems.length > 0) {
                           for (var index = 0; index < ticketBayContextMenuItems.length; index++) {
                               var description = ticketBayContextMenuItems[index].Value;
                               var value = ticketBayContextMenuItems[index].Key;
                               if (description == "_BreakLine_") {
                                   var menuItem = new Telerik.Web.UI.RadMenuItem();
                                   menuItem.set_isSeparator(true);
                                   menu.get_items().add(menuItem);
                               }
                               else {
                                   var contextMenuItem = new Telerik.Web.UI.RadMenuItem();
                                   contextMenuItem.set_text(description);
                                   contextMenuItem.set_value(value);

                                  
                                   menu.get_items().add(contextMenuItem);

                                   if (apptID1 < 1) {
                                       if (description == "Show In M4")
                                           contextMenuItem.set_visible(false);
                                       else if (description == "Exclude from Appointment Optimization")
                                           contextMenuItem.set_visible(false);
                                       else if (description == "Show Route")
                                           contextMenuItem.set_visible(false);
                                       else if (description == "Directions")
                                           contextMenuItem.set_visible(false);
                                       else if (description == "Find Tech")
                                           contextMenuItem.set_visible(false);
                                   }


                                   if (value == "ChangeTicketState") {
                                       if (ticketStatuses.length == 0) {
                                           contextMenuItem.set_visible(false);
                                       }
                                       else {
                                           for (var indexRCItem = 0; indexRCItem < ticketStatuses.length; indexRCItem++) {
                                               var destinationStateID = ticketStatuses[indexRCItem].DestinationState;
                                               var transitionName = ticketStatuses[indexRCItem].TransitionName
                                               var destinationStateID = ticketStatuses[indexRCItem].DestinationState;
                                               var nextTransitionItem =  new Telerik.Web.UI.RadMenuItem();
                                               nextTransitionItem.set_text(transitionName);
                                               nextTransitionItem.set_value(destinationStateID);
                                               $(nextTransitionItem).css("width", "100%");
                                               contextMenuItem.get_items().add(nextTransitionItem);

                                           } //end of for loop  
                                       }//end of if
                                   }
                                   else if (value == "BumpStatus") {
                                       if (result.BumpStatuses.length == 0) {
                                           contextMenuItem.set_visible(false);
                                       }
                                       else {
                                           for (var indexBS = 0; indexBS < bumpStatuses.length; indexBS++) {
                                               var code = bumpStatuses[indexBS].Code;
                                               var description = bumpStatuses[indexBS].Description;
                                               var bsMenuItem = new Telerik.Web.UI.RadMenuItem();
                                               bsMenuItem.set_text(description);
                                               bsMenuItem.set_value(code);
                                               $(bsMenuItem).css("width", "100%");
                                               contextMenuItem.get_items().add(bsMenuItem);
                                           }//end of for loop
                                       }//end of else
                                   }//end of if (value == "BumpStatus")


                               }//end of else not break line
                           } //end of for loop

                       }// end of if (ticketBayContextMenuItems.length > 0)

                     
                $(contextMenuItem).css("width", "100%");
                menu.commitChanges();
                $(contextMenuItem).css("width", "100%");
               menu.show(evt);
               evt.cancelBubble = true;
               evt.returnValue = false;

               if (evt.stopPropagation) {
                       evt.stopPropagation();
                       evt.preventDefault();
               }

           };


           serviceOptions.error = function (xhr) {
                   alert('Error:' + xhr.statusText);
                  menu.trackChanges();
                  menu.get_items().clear();
                   menu.commitChanges();

                   menu.show(evt);
                   evt.cancelBubble = true;
                   evt.returnValue = false;

                   if (evt.stopPropagation) {
                       evt.stopPropagation();
                       evt.preventDefault();
                   }
           };


           var workforceServiceProxy = new WorkforceServiceProxy(serviceOptions);
           workforceServiceProxy.callService();

}






Here is my html tag for grid and contextmenu
..................................................................................

 <telerik:RadGrid ID="rgTicketsGrid" runat="server"  AllowPaging="true"
                         
                        .................................................................. >
                            <MasterTableView AllowFilteringByColumn="False" .................................>
                            </MasterTableView>
                          
                          
                            <ClientSettings AllowDragToGroup="True" AllowRowsDragDrop="True" EnableRowHoverStyle="True">
                                        <ClientEvents OnRowContextMenu="GetInformationFromServerAndCreateTicketBayContextMenuItems"   />
                            </ClientSettings >
             
                      
                  
                            ...................................................................................................................
                        </telerik:RadGrid>

                        <telerik:RadContextMenu ID="cmTechFilter" runat="server" EnableRoundedCorners="true"
                            EnableShadows="true" EnableViewState="true" OnClientItemClicked="TicketBay_ContextMenuClicked"  >   
      
                        </telerik:RadContextMenu>
Thanks,
Prava
Prava kafle
Top achievements
Rank 1
 answered on 02 Feb 2015
1 answer
284 views
So far I have been able to successfully dynamically load a radtreeview inside a radpanelbar. There are just 2 issues i'm facing now and hopefully someone could help me out. 

Issue 1.

After a post back (control added to an ajaxmanager) generated from a radpanel item selected event, my radtreeview disappears.

Issue 2.

RadTreeView node click event does not fire.

I will paste brief segments of my code below. 

ParentChildItems = function that returns a List<Child> object full of children...

foreach (Child child in ParentChildItems)
                    {
                        RadTreeView treeView = new RadTreeView();
                        RadPanelItem item = new RadPanelItem(child.Display);
                        RadPanelItem itemFolder = new RadPanelItem();
                        item.Value = child.ChildID;
 
                        List<Object> folders = new Child(General.DB).findAllFoldersByDrawer(child.ChildID);
 
                        if (folders.Count > 1)
                        {
                            treeView.ID = child.ChildID + "_tView";
                            treeView.NodeClick += new RadTreeViewEventHandler(treeView_NodeClick);
                            treeView.CheckChildNodes = true;
 
                            RadTreeNodeBinding binding = new RadTreeNodeBinding();
                            binding.Expanded = true;
                            treeView.DataBindings.Add(binding);
                            treeView.DataTextField = "Display";
                            treeView.DataFieldID = "ChildID";
                            treeView.DataValueField = "ChildID";
                            treeView.DataFieldParentID = "ChildChildID";
                            treeView.DataSource = folders;
                            treeView.ShowLineImages = true;
                            treeView.DataBind();
 
                            itemFolder.Controls.Add(treeView);
                            item.Items.Add(itemFolder);
                        }
 
                        pnlDrawers.Items.Add(item);
 
                        if (folders.Count > 1)
                        {
                            AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, treeView, RadAjaxLoadingPanel1, UpdatePanelRenderMode.Inline);
                            AjaxManager.AjaxSettings.AddAjaxSetting(pnlDrawers, treeView, RadAjaxLoadingPanel1, UpdatePanelRenderMode.Inline);
                            AjaxManager.AjaxSettings.AddAjaxSetting(treeView, treeView, RadAjaxLoadingPanel1, UpdatePanelRenderMode.Inline);
                        }
                    }


public class Child
    {
        #region properties
        public string ChildID { get; set; }
        public string ParentID { get; set; }
        public string ChildChildID { get; set; }
        public string Label { get; set; }
        public string FirstName { get; set; }
        public string MName { get; set; }
        public string Lastname { get; set; }       
}


Ivan Danchev
Telerik team
 answered on 02 Feb 2015
14 answers
340 views
Hello,

I am doing some functionality with drag & drop effect in which I have to drag from one listview to another listview and also in the same listview for reordering purposes. What happens is that I can't capture the drop when user drops inside the listview but outside an html element (LinkButton, Label, etc).

What I tried to do was to put in my ItemTemplate a div running at server and then tried with a Panel containing the data I'm showing in the ListView, so my codebehind could capture this as a htmlElement, but it won't, DestinationHtmlElement is an empty element.

What should I do??

I was looking the ListBox aproximation and the drag & drop example is more or less what I am looking for, but I did not use that because I have to customize the List content as a Link followed by a Label and also it shouldn't have a scroll but it should have a variable height depending on the ammount of data it has

Hope you can help me soon, and if you didn't understand me just let me know

Thanks in advance,

Camilo
Pavlina
Telerik team
 answered on 02 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?