Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
68 views
Binding the radcomboboxes in the edit item template in radgrid,where two radcomboboxes has relation.and they had to be selected when we  click edit.

Example:

I have two radcombobboxes in two  Different  EditItem Templates's ,one radcombobox consists of country's and based on the selection of the country another rad combobox is get databinded with city.

While inserting there is no problem,but when i click edit the radcomboboxes are not been selected with there selected values.
Veselin Vasilev
Telerik team
 answered on 16 Dec 2009
2 answers
384 views
How to Set the Default Font to the Rad Editor

By default  it is taking the Default  System font(Times New Roman) in my system
How to add The Fonts List to the RadEditor
Please help me to find the Solution
Rumen
Telerik team
 answered on 16 Dec 2009
3 answers
188 views
Hello,

Is it possible to only load the controls inside of RadSlidingPane when the pane is being expanded?  I can only see client events that can handle expand/collapse actions.  Is it possible to handle these type of events on the server side?

thank you,

Jerry
Svetlina Anati
Telerik team
 answered on 16 Dec 2009
1 answer
114 views
Hi,

I have been having some trouble with the following:

My application has a number of RadNumericTextboxes, in which decimal numbers are entered. My current (and desired) culture settings use a ',' as a decimal separator. My users want to be able to use the '.' on their numeric pad for entering it (much like calc.exe does, it accepts both ',' and '.' and enters a ',').
This does not work with the control and I don't think there is a direct way of setting this option.
If there is an option, please tell me.

As I expect there is no such option, I have written a piece of javascript to handle the OnKeyPress event:
function Dot2Comma(sender, eventArgs) { 
      var c = eventArgs.get_keyCharacter(); 
      if (c == '.') { 
        eventArgs.set_cancel(true); 
        sender.Value = sender.Value + ','; 
      } 
    } 

It goes wrong on the line "sender.Value = sender.Value + ',';" is there any way of adding the ',' from javascript?

Would it be possible to add this functionality in a later version of the telerik radcontrols?
Dimo
Telerik team
 answered on 16 Dec 2009
4 answers
257 views
Hello,
I may have some trouble about Dynamic Saving & Loading docks from MS SQL DATABASE.

Please Help Me!!!

This is my default.cs file!

is there any sample for "dynamic add" + "SAVE&LOAD" for us?

error message "serializer doesn't support 'Telerik.Web.UI.DockState'." 
 
using System;  
using System.Data;  
using System.Data.SqlClient;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using System.Web.Script.Serialization;  
using System.Collections.Generic;  
using Telerik.Web.UI;  
using System.Text;  
 
public partial class index : System.Web.UI.Page  
{  
    protected string LoadUserData(string UserAccount)  
    {  
        SqlConnection conn = new SqlConnection("Data Source=(LOCAL);;Initial Catalog=BPMDB;User ID=sa;Password=*******");  
        conn.Open();  
 
        string SQLStr = "SELECT  [string] FROM [index_position] WHERE (id_user = '" + UserAccount + "')";  
        SqlCommand cmd3 = new SqlCommand(SQLStr, conn);  
        SqlDataAdapter sda = new SqlDataAdapter(cmd3);  
        DataTable dt = new DataTable();  
        sda.Fill(dt);  
        string posiStr = dt.Rows[0].ItemArray[0].ToString();  
        return posiStr;  
    }  
    protected bool UserDataChecker(string UserAccount)  
    {  
        SqlConnection conn = new SqlConnection("Data Source=(LOCAL);;Initial Catalog=BPMDB;User ID=sa;Password=1*********");  
        conn.Open();  
 
 
        string SQLStr = "SELECT  [string] FROM [index_position] WHERE (id_user = '" + UserAccount + "')";  
        SqlCommand cmd3 = new SqlCommand(SQLStr, conn);  
          
        SqlDataReader dr = cmd3.ExecuteReader();  
        if (dr.Read())  
        {  
            //not insert  
 
            return true;  
        }  
        else 
        {  
            //insert   
 
            return false;  
        }  
          
 
    }  
 
 
 
    private bool _dockStateCleared = false;  
    private List<DockState> CurrentDockStates  
    {  
        get 
        {  
 
              
            List<DockState> _currentDockStates = (List<DockState>)Session["CurrentDockStatesMyPortal"];//UserDataLoader(AspxHelper.LoginUserAccount.ToString());  
              
 
             
            if (Object.Equals(_currentDockStates, null))  
            {  
                _currentDockStates = new List<DockState>();  
                Session["CurrentDockStatesMyPortal"] = _currentDockStates;  
 
            }  
 
 
            return _currentDockStates;  
        }  
        set 
        {  
 
            Session["CurrentDockStatesMyPortal"] = value;  
        }  
    }  
    //private List<DockState> CurrentDockStates = new List<DockState>();  
    protected void Page_Init(object sender, EventArgs e)  
    {  
        //if(UserDataChecker(AspxHelper.LoginUserAccount.ToString()))  
        //         CurrentDockStates = UserDataLoader(AspxHelper.LoginUserAccount.ToString());  
        foreach (DockState state in CurrentDockStates)  
        {  
            if (state.Closed == false)  
            {  
                RadDock dock = CreateRadDockFromState(state);  
                RadDockLayout1.Controls.Add(dock);  
                CreateSaveStateTrigger(dock);  
                LoadWidget(dock);  
            }  
        }  
          
 
    }  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
        PageHeader1.SelectedPageIndex = 0;  
        this.Title = "SmartBPM.NET--" + PageHeader1.SelectedPageName;  
        if (!IsPostBack)  
        {  
            DropDownZone.DataBind();  
        }  
    }  
 
      
 
    private void LoadWidget(RadDock dock)  
    {  
        if (string.IsNullOrEmpty(dock.Tag))  
        {  
            return;  
        }  
        Control widget = LoadControl(dock.Tag);  
        dock.ContentContainer.Controls.Add(widget);  
    }  
    private void CreateSaveStateTrigger(RadDock dock)  
    {  
        //Ensure that the RadDock control will initiate postback  
        // when its position changes on the client or any of the commands is clicked.  
        //Using the trigger we will "ajaxify" that postback.  
        dock.AutoPostBack = true;  
        dock.CommandsAutoPostBack = true;  
 
        AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger();  
        saveStateTrigger.ControlID = dock.ID;  
        saveStateTrigger.EventName = "DockPositionChanged";  
        UpdatePanel1.Triggers.Add(saveStateTrigger);  
 
        saveStateTrigger = new AsyncPostBackTrigger();  
        saveStateTrigger.ControlID = dock.ID;  
        saveStateTrigger.EventName = "Command";  
        UpdatePanel1.Triggers.Add(saveStateTrigger);  
    }  
    private RadDock CreateRadDockFromState(DockState state)  
    {  
        //建立一個dock並設定可用之動作(關閉、收合)  
        RadDock dock = new RadDock();  
        dock.DockMode = DockMode.Docked;  
        dock.ID = string.Format("RadDock{0}", state.UniqueName);  
        dock.ApplyState(state);  
        dock.Commands.Add(new DockCloseCommand());  
        dock.Commands.Add(new DockExpandCollapseCommand());  
 
        return dock;  
    }  
    private RadDock CreateRadDock(string title)  
    {  
        int docksCount = CurrentDockStates.Count;  
 
        RadDock dock = new RadDock();  
        dock.DockMode = DockMode.Docked;  
        dock.UniqueName = Guid.NewGuid().ToString();  
        dock.ID = string.Format("RadDock{0}", dock.UniqueName);  
        dock.Title = title;  
        dock.Text = string.Format("Added at {0}", DateTime.Now);  
        dock.Width = Unit.Pixel(300);  
 
        dock.Commands.Add(new DockCloseCommand());  
        dock.Commands.Add(new DockExpandCollapseCommand());  
 
        return dock;  
    }  
 
   
    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)  
    {  
        //CurrentDockStates = UserDataLoader(AspxHelper.LoginUserAccount.ToString());  
        JavaScriptSerializer serializer = new JavaScriptSerializer();  
        string str = LoadUserData(AspxHelper.LoginUserAccount.ToString());  
        string[] currentDockStates2 = str.Split('|');   
        foreach (string stringState in currentDockStates2)   
        {  
            if (stringState != string.Empty)  
            {  
                DockState state = serializer.Deserialize<DockState>(stringState);  
                e.Positions[state.UniqueName] = state.DockZoneID;  
                e.Indices[state.UniqueName] = state.Index;  
            }  
        }  
    }       
 
          
      
    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)  
    {  
        string dockState;  
        JavaScriptSerializer serializer = new JavaScriptSerializer();  
        List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState();  
        StringBuilder serializedList = new StringBuilder();  
        int i = 0;  
        while (i < stateList.Count)  
        {  
            serializedList.Append(serializer.Serialize(stateList[i]));  
            serializedList.Append("|");  
            i++;  
        }  
        dockState = serializedList.ToString();  
        bool ExistOrNot = UserDataChecker(AspxHelper.LoginUserAccount.ToString());  
        SqlConnection conn = new SqlConnection("Data Source=(LOCAL);;Initial Catalog=BPMDB;User ID=sa;Password=16*******");  
        conn.Open();  
        if (ExistOrNot)  
        {  
            //update  
            string SQLStr = "UPDATE index_position SET string='" + dockState + "' WHERE id_user = '" + AspxHelper.LoginUserAccount + "'";  
            SqlCommand cmd3 = new SqlCommand(SQLStr, conn);  
            cmd3.ExecuteNonQuery();  
        }  
        else 
        {  
            //insert  
            string SQLStr = "INSERT INTO index_position(id_user,string)VALUES('" + AspxHelper.LoginUserAccount + "','" + dockState + "')";  
            SqlCommand cmd3 = new SqlCommand(SQLStr, conn);  
            cmd3.ExecuteNonQuery();  
        }  
 
         
    }  
 
    public ArrayList GetZones()  
    {  
        ArrayList zones = new ArrayList();  
        zones.Add(RadDockZone1);  
        zones.Add(RadDockZone2);  
 
        return zones;  
    }  
 
    protected void ButtonAddDock_Click(object sender, EventArgs e)  
    {  
        RadDock dock = CreateRadDock(DroptDownWidget.SelectedItem.Text);  
 
        //find the target zone and add the new dock there  
        RadDockZone dz = (RadDockZone)FindControl(DropDownZone.SelectedItem.Text);  
        dz.Controls.Add(dock);  
 
        CreateSaveStateTrigger(dock);  
 
        //Load the selected widget in the RadDock control  
        dock.Tag = DroptDownWidget.SelectedValue;  
        LoadWidget(dock);  
    }  
    protected void ButtonPostBack_Click(object sender, EventArgs e)  
    {  
         
    }  
    protected void ButtonClear_Click(object sender, EventArgs e)  
    {  
         
    }  
     
}  
 
Pero
Telerik team
 answered on 16 Dec 2009
1 answer
83 views
How can I have the image of the selected item show in the combo box itself?
Princy
Top achievements
Rank 2
 answered on 16 Dec 2009
3 answers
137 views
I have the grid with the following settings.  What is happening is when I click on the row the grid expands to the right and goes off screen.  What would be causing this?

 <telerik:RadGrid ID="RadGrid2"    
          AllowMultiRowSelection="True"   
          AllowSorting="True" 
          AllowNaturalSort="True"   
          AutoGenerateColumns="False"   
          AlternatingItemStyle-HorizontalAlign="Center" 
          BackColor="#ffffff"   
          CellPadding="2"   
          CellSpacing="2"   
          GridLines="None"   
          GroupingEnabled="False" 
          HeaderStyle-Height="20"   
          Height="200"   
          ItemStyle-HorizontalAlign="Center"   
          OnItemCommand="RadGrid2_ItemCommand"   
          OnItemDataBound="RadGrid2_ItemDataBound"   
          SelectedItemStyle-ForeColor="#000000"                         
          SelectedItemStyle-BackColor="lightyellow"    
          ShowHeader="True"   
          Skin="Telerik"   
          Width="100%"   
          runat="server">  
 
   <MasterTableView AllowMultiColumnSorting="False" DataKeyNames="ID,NUMBER" EditMode="InPlace" TableLayout="Fixed" HeaderStyle-Wrap="false" Width="100%">  
     <Columns> 
     .............  
     </Columns> 
    </MasterTableView> 
         <ClientSettings AllowColumnsReorder="True">  
             <Resizing AllowColumnResize="True" AllowRowResize="False" ResizeGridOnColumnResize="False" /> 
             <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"/>  
             <Selecting AllowRowSelect="True" /> 
          </ClientSettings> 
</telerik:RadGrid> 
Pavlina
Telerik team
 answered on 16 Dec 2009
3 answers
623 views
Hi

I'm busy building a project where I've added the RadMenu into my master page, I populate the menu items with a datatable.
I need the user to be able to open the menu items including the root items in a new tab / window when right clicking on the menu items (as if right clicking on a hyperlink).
This option only seems to be available when you set the ImageUrl property in the individual menu items. Is there a way around this or do I have to use hyperlinks as item templates?

Regards
Erika
Kamen Bundev
Telerik team
 answered on 16 Dec 2009
1 answer
94 views
I'm having an issue with the MOSSRadEditor control. It was working now it's not anymore. I get a javascript error on the page OnClientModeChange is undefined.

the code is this
protected MOSSRadEditor _txtSummary;  
_txtSummary = new MOSSRadEditor();  
_txtSummary.ID = "txtSummary";  
_txtSummary.Height = Unit.Pixel(300);  
 
//getting content  
_txtSummary.Content = Item["Summary"].ToString();  
 
//setting content  
Item["Summary"] = _txtSummary.Content; 

The control render the box on the page, but no tool bars and the content zone is not clickable.

Lini
Telerik team
 answered on 16 Dec 2009
3 answers
101 views
Hello,

I am using RadControls for ASP.NET AJAX v2009.2.1028.35.

I am having this weird error in IE8 (I tested so far also in Chrome and no error) when using insertItems method:

Line: 2423
Error: 'this._element' is null or not an object

but it happens only when I am inserting lots of items (starting at ~ 4000). Anyway, after this error, the items are properly inserted.

Can you help me on this please?

Thank you very much for your products and support!
Genady Sergeev
Telerik team
 answered on 16 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?