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

I am able to obtain the RadcolorPicker object on in the following case:

serverside code(aspx.cs)

                protected void Page_Load(object sender, EventArgs e)
{
            dropdownList1.Attributes.Add("onchange", "javascript:clddIndicesList_onchange();");
                 }

Clientside code:(aspx)

         function clddIndicesList_onchange()
{
       radColorPicker.set_visible(true);
             
        }

but RadColorPicker object will be 'null' in the following cases
1) <body onload="clddIndicesList_onchange()">

2) End of the aspx page <script language="javascript" type="text/javascript">clddIndicesList_onchange();</script>

Please let me know the solution for this?

Svetlina Anati
Telerik team
 answered on 13 Jan 2009
0 answers
54 views
Hi,

Is there any way to add programmatically new asp.net controls to a RadTreeNode.

dim oNode as RadTreeNode
dim oTextBox as new Textbox

oTextBox.Text="Test"
oNode.Controls.add(oTextBox)

When i'm tring to do that i'm loosing the text of the oNode.
Also when i hover the new TextBox is getting underline and has the color of the oNode text.


thanks in advance
Lingo
Top achievements
Rank 1
 asked on 13 Jan 2009
0 answers
49 views
Hi all,
please show your support if you see the necesity in the above property, which allows you to choose the dropdown list floating direction
(left or right), and by this aligning it's right border to the input cell right border or its left border to the input cell left border.

Telerik said :
"Currently RadComboBox does not support this functionailty out-of-the-box. If the demand for it increases in the future we may consider incorporating it in the control."

see : http://www.telerik.com/community/forums/aspnet-ajax/combobox/combobox-drop-down-location.aspx#718149


Thank you,
Revital
Revital Keren
Top achievements
Rank 1
 asked on 13 Jan 2009
1 answer
69 views
Is it possible to show HORIZONTAL scrollbar on timelineview keeping the width of the scheduler fixed?
Peter
Telerik team
 answered on 13 Jan 2009
4 answers
122 views
Hello,

I implemented the code similar to the demo at http://demos.telerik.com/aspnet-ajax/Grid/Examples/GeneralFeatures/Filtering/DefaultCS.aspx in regards to the Radio buttons to hide and show filtering.  The problem is, however, that instead of hiding and showing the filtering it is hiding and showing the header columns.  Any idea as to why this could be?
Ryan Moore
Top achievements
Rank 1
 answered on 13 Jan 2009
3 answers
210 views
Hello.

I'm using Telerik RadEditor 7.3.2.0 and I have the following problem.

I have a text in MS Word with TimeRoman 11 font. I have initialized RadEditor with 

Editor.StripFormattingOnPaste =

EditorStripFormattingOptions.MSWordRemoveAll

 

and the unique font is Arial 14.

When I copy the text in from MS-Word and I paste it into the Editor with the Paste from Word button, it works fine. The text is converted to Arial 14.
Right after that I paste using the IE Edit / Paste menu item and the text is appended to the previous block but with font TimesRoman 11.
Then I paste again with the Paste from Word button and the text is pasted as TimesRoman instead of Arial.

It seems that after a paste from outside the editor (IE menu item), the Paste from Word does not clear the font settings.

1. How can we avoid this situation ?
2. Is it a way to apply the FormattingOptions even if the paste action is coming from the IE menu ?

Thanks for your help.
Regards
Augusto
Rumen
Telerik team
 answered on 13 Jan 2009
4 answers
283 views
Hi,

I'm trying to use the set_cancel() function in the client side OnRowClick event and it said the function does no exist.

The help file says "Can Be Cancelled: Yes, meaningful when setting ClientSettings -> EnablePostBackOnRowClick to true" and even has sample code demonstrating it. I do have enablepostbackonrowclick set to true but the method cannot be found.

eventArgs is returning an object and I can successfully get the data grid item from it.

Any ideas?

Thanks,
Vandara Peou
Daniel
Telerik team
 answered on 13 Jan 2009
1 answer
108 views
I am writing to determine if the behavior I'm seeing is intended functionality or if I've made a simple mistake.  I have configured the Telerik controls on my my master page as follows:

<telerik:RadSplitter ID="LeftSide" runat="server" Width="28px"
    <telerik:RadPane ID="ParamsPane" runat="server" Scrolling="none" Locked="false" BackColor="#FFCC00"
        <telerik:RadSlidingZone ID="ParamsSlidingZone" runat="server"
            <telerik:RadSlidingPane ID="ParamsSlidingPane" runat="server" Title="Parameters" 
                Width="300px" BackColor="#FFCC00" MinHeight="400" MinWidth="300"
                <p> 
                    <asp:Label ID="noCookie" runat="server" Text="As this is the first time you are running these dashboards, please set your preferred values for the following parameters.<br /><br />" 
                        Font-Size="Large" ForeColor="#C41200" Visible="False"></asp:Label> 
                </p> 
                <p> 
                    <telerik:RadPanelBar Skin="Gray" ID="PickersPanelBar" runat="server" AllowCollapseAllItems="true" 
                        ExpandMode="SingleExpandedItem" EnableViewState="true" Width="100%"
                        <Items> 
                            <telerik:RadPanelItem Text="Case Type" runat="server"
                                <Items> 
                                    <telerik:RadPanelItem runat="server"
                                        <ItemTemplate> 
                                            Picker Control Goes Here 
                                        </ItemTemplate> 
                                    </telerik:RadPanelItem> 
                                </Items> 
                            </telerik:RadPanelItem> 
                        </Items> 
                        <CollapseAnimation Duration="100" Type="None" /> 
                        <ExpandAnimation Duration="100" Type="None" /> 
                    </telerik:RadPanelBar> 
                </p> 
                <style="text-align: right"
                    <br /> 
                    <asp:Button ID="submitPickers" runat="server" Text="Save & Run" OnClick="submitPickers_Click" /> 
                </p> 
            </telerik:RadSlidingPane> 
        </telerik:RadSlidingZone> 
    </telerik:RadPane> 
    <telerik:RadPane ID="RightPane" runat="server" Scrolling="none" MinWidth="600"
        <telerik:RadSplitter ID="RightSide" runat="server" Orientation="horizontal" Width="600px"
            <telerik:RadPane ID="TabsPane" runat="server" Scrolling="none" Locked="true" BackColor="#FFCC00" 
                MinHeight="28" MinWidth="600"
                <telerik:RadTabStrip ID="DashboardTabs" runat="server" Skin="Telerik"
                    <Tabs> 
                        <telerik:RadTab runat="server" Text="Quality" NavigateUrl="Quality.aspx" ImageUrl="~/Images/GreenCircleCheck.GIF"
                        </telerik:RadTab> 
                        <telerik:RadTab runat="server" Text="Backlog" NavigateUrl="Backlog.aspx" ImageUrl="~/Images/OrangeWarning.GIF"
                        </telerik:RadTab> 
                    </Tabs> 
                </telerik:RadTabStrip> 
            </telerik:RadPane> 
            <telerik:RadPane ID="ContentsPane" runat="server" Scrolling="none" BackColor="#FFCC00" 
                MinHeight="400" MinWidth="600"
                <asp:ContentPlaceHolder ID="cphDashboard" runat="server"
                </asp:ContentPlaceHolder> 
            </telerik:RadPane> 
            <telerik:RadPane ID="FooterPane" runat="server" Scrolling="none" Locked="true" BackColor="#FFCC00" 
                MinHeight="28" MinWidth="600"
                <table width="100%"
                    <tr> 
                        <td style="width: 99%"
                            <style="font-size: medium; text-align: center"
                                SymMetrics Dashboards</p> 
                        </td> 
                        <td style="width: 1%"
                            <asp:Button ID="RescaleButton" runat="server" Text="Rescale" OnClick="RescaleButton_Click" /> 
                        </td> 
                    </tr> 
                </table> 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
    </telerik:RadPane> 
</telerik:RadSplitter> 

I am checking for a cookie on the user's computer and if it doesn't exist then I'm expanding the ParamsSlidingPane RadSlidingPane to fill the browser window, pin it, and then disallow unpinning so that they are forced to use the submit button to validate the selections made on the RadSlidingPane and then write them to a cookie.  I set the session variable for WindowWidth using another page with some Javascript.  As that isn't pertinent to this, I'm not including it.  Here is the server-side code for the above described:

// Check user's cookies for picker values 
HttpCookie Parameters = Request.Cookies["Parameters"]; 
// If there is no cookie... 
if (Parameters == null
    // ...slide the pickers pane to full screen width... 
    ParamsSlidingPane.Width = Unit.Pixel(int.Parse(Session["WindowWidth"].ToString()) - (int)ParamsPane.Width.Value - 2); 
    ParamsSlidingZone.ExpandedPaneId = ParamsSlidingPane.ClientID; 
    // ...pin it... 
    ParamsSlidingZone.DockedPaneId = ParamsSlidingPane.ClientID; 
    // ...block unpinning so they have to use the submit button... 
    ParamsSlidingPane.OnClientBeforeUndock = "BlockUndock"
    // ...hide the right pane... 
    RightPane.Visible = false
    // ...and show a message 
    noCookie.Visible = true
 

The code I'm using to prevent unpinning of the ParamsSlidingPane is simple and provided mainly for anyone else, like myself, who has been puzzling over this but also for completeness.

<script type="text/javascript">   
    function BlockUndock(sender, Args)   
    {   
        Args.set_cancel(true);   
    } 
</script> 

That described, the behavior is that if I hide the RightPane RadPane, then the ParamsSlidingPane RadSlidingPane won't pin.  If I comment out the code to hide the RightPane RadPane, then it pins fine but that causes scroll bars to occur and the contents of the RightPane, which are invalid until the cookie is set, can be seen if the user scrolls over.  If I comment out the RightSide RadSplitter, then the pinning works fine but I still get scroll bars with no contents, only the frame of the RadSplitter.

The goal here is simple -- show the parameters pane if there is no cookie and don't let the user see anything but the parameters pane until he sets the parameters.  Any guidance would be appreciated.
Tsvetie
Telerik team
 answered on 13 Jan 2009
4 answers
206 views
I create a small application in server side which performs same function like EnableHeaderContextMenu. And also i save the selected  column name  in Database, so that the next time the grid loads with the column which is saved  in the database.Everything is done fine without ajax. But  when I tried for ajax  the  column is not updated in the grid. Please help me in this reqard. I am using Master page  for ajax.

main.aspx.cs:

 protected void Page_Load(object sender, EventArgs e)  
        {  
            RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);  
            manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest);  
        }  
 
        protected void manager_AjaxRequest(object sender, AjaxRequestEventArgs e)  
        {  
              
 
            if (e.Argument == "Rebind")  
 
            {  
 
                RadGrid grid = pnlCompany.FindControl("radGvProspectList"as RadGrid;  
                grid = objGrid.CreateGrid("GetProspect""Prospect");  
                 grid.Rebind();  
 
              
            }  
        }    
 
 
        protected void Page_Init(object sender, System.EventArgs e)  
        {  
             
             radgrid = CreateGrid("GetProspect""Prospect");  
            radgrid.ID = "radGvProspectList";  
            //radgrid.ItemCommand += new GridCommandEventHandler(radgrid_ItemCommand);  
            //radgrid.SelectedIndexChanged += new EventHandler(radgrid_SelectedIndexChanged);  
 
            pnlCompany.Controls.Add(radgrid);  
 
 
        }  
 
 
Main.aspx:
<asp:Panel ID="pnlCompany" runat="server" Height="700px" Width="700px">  
         
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
         <script language="javascript">  
        function refreshGrid()  
                {  
                      
                  $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Rebind");  
                      
                }  
 
        </script> 
          
        </telerik:RadCodeBlock> 
         
               
    </asp:Panel> 

GeneralGrid.cs:
 public class GridStructure:System.Web.UI.Page  
    {  
 
          
         private DataTable dbsource;  
public void Set(DataTable dt)  
{  
dbsource= dt;  
}  
public DataTable Get()  
{  
return dbsource;  
}  
 
        
 
             
 
         
 
 
         public RadGrid CreateGrid(string SPName,string PageName)  
        {  
              
 
 
 
            GridConfig temp = new GridConfig();  
            SelectBL objSelectBL;  
 
 
            DataTable dtLogin, dtGrid;  
            // for sendind sql stored procedure's parameteres  
            object[] arrSpParameters, parm;  
            RadGrid objRadGrid = new RadGrid();  
            ArrayList colname = new ArrayList();  
 
            dtLogin = new DataTable();  
            dtGrid = new DataTable();  
            objSelectBL = new SelectBL();  
            arrSpParameters = new object[2];  
            arrSpParameters[0] = 21;// Session["UserID"];  
            arrSpParameters[1] = PageName;  
 
 
            dtGrid = objSelectBL.Retrieve(SPName);  
            string[] gridDataKeyNames = new string[dtGrid.Columns.Count];  
            int k = 0;  
            foreach (DataColumn dc in dtGrid.Columns)  
            {  
                colname.Add(dc.ColumnName.ToString());  
                gridDataKeyNames[k] = dc.ColumnName.ToString();  
                k++;  
            }  
 
            foreach (string column in colname)  
            {  
                objRadGrid.MasterTableView.Columns.Add(CreateColumn(column));  
 
            }  
 
             
            Session["ColumnName"] = colname;  
            Session["PageName"] = PageName;  
            objRadGrid.MasterTableView.DataKeyNames = gridDataKeyNames;  
 
            objRadGrid.Skin = "Outlook";  
            objRadGrid.Width = Unit.Percentage(100);  
            objRadGrid.AllowPaging = true;  
            objRadGrid.AllowSorting = true;  
            objRadGrid.PagerStyle.Mode = GridPagerMode.NextPrevNumericAndAdvanced;  
            objRadGrid.AutoGenerateColumns = false;  
            objRadGrid.ShowStatusBar = true;  
            objRadGrid.MasterTableView.EnableColumnsViewState = false;  
            objRadGrid.ClientSettings.Selecting.AllowRowSelect = true;  
            objRadGrid.ClientSettings.EnablePostBackOnRowClick = true;  
            objRadGrid.MasterTableView.PageSize = 19;  
            objRadGrid.SelectedItemStyle.BackColor = System.Drawing.Color.AliceBlue;  
 
            objRadGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;  
            objRadGrid.ItemCommand += new GridCommandEventHandler(objRadGrid_ItemCommand);  
            objRadGrid.NeedDataSource += new GridNeedDataSourceEventHandler(objRadGrid_NeedDataSource);  
            objRadGrid.PreRender += new EventHandler(objRadGrid_PreRender);  
            objRadGrid.MasterTableView.CommandItemTemplate = temp;  
 
 
 
            dbsource = dtGrid;  
 
              
 
 
              
 
 
             
              
 
              
 
             
            return objRadGrid;  
 
 
        }  
 
         void objRadGrid_PreRender(object sender, EventArgs e)  
         {  
             RadGrid objRadGrid = (RadGrid)sender;  
             GridConfig temp = new GridConfig();  
             SelectBL objSelectBL;  
 
 
             DataTable dtLogin, dtGrid;  
             // for sendind sql stored procedure's parameteres  
             object[] arrSpParameters, parm;  
              
             ArrayList colname = new ArrayList();  
 
             dtLogin = new DataTable();  
             dtGrid = new DataTable();  
             objSelectBL = new SelectBL();  
             arrSpParameters = new object[2];  
             arrSpParameters[0] = 21;// Session["UserID"];  
             arrSpParameters[1] = "Prospect";  
             ArrayList result = new ArrayList();  
 
             dtLogin = objSelectBL.Retrieve("GetGridRights", arrSpParameters);  
             if (dtLogin.Rows.Count > 0)  
             {  
                 string strContent = Convert.ToString(dtLogin.Rows[0][0]);  
                 if (strContent != string.Empty)  
                 {  
                     string[] te = strContent.Split('#');  
                       
                     foreach (string sqe in te)  
                     {  
                         result.Add(sqe);  
                     }  
                 }  
             }  
 
             Session["DiffColumn"] = result;  
 
             foreach(GridColumn c in objRadGrid.Columns)  
             {  
                 if (result.Contains(c.HeaderText))  
                 {  
                     c.Display = false;  
                 }  
                   
             }  
         }  
 
           
 
           
 
         void objRadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
         {  
             RadGrid objRadGrid = (RadGrid)source;  
             objRadGrid.DataSource = dbsource;  
               
         }  
 
        void objRadGrid_ItemCommand(object source, GridCommandEventArgs e)  
        {  
            RadGrid objRadGrid = (RadGrid)source;  
 
            if (e.CommandName == "Configure")  
            {  
                RadWindow objRadWindow = new RadWindow();  
                objRadWindow.OpenerElementID = objRadGrid.ClientID;  
                objRadWindow.OffsetElementID = objRadGrid.ClientID;  
                objRadWindow.VisibleOnPageLoad = true;  
 
                  
                objRadWindow.NavigateUrl = "~/Common Page/Configure.aspx";  
                 
 
                objRadGrid.Controls.Add(objRadWindow);  
 
            }  
        }  
 
 
 
 
          
 
        public GridBoundColumn CreateColumn(string column)  
        {  
 
            GridBoundColumn boundColumn = new GridBoundColumn();  
            boundColumn.DataField = column;  
            boundColumn.HeaderText = column;  
            boundColumn.UniqueName = column;  
 
            return boundColumn;  
        }  
 
 
 
 
 
 
 
 
 

Configure.aspx.cs:

 public partial class Configure : System.Web.UI.Page  
    {  
         
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
                ArrayList colum = (ArrayList)Session["ColumnName"];  
 
                    foreach (string regionRow in colum)  
                    {  
 
                        RadTreeNode regionNode = new RadTreeNode(regionRow);  
                        regionNode.Checked = true;  
                        RadTreeView1.Nodes.Add(regionNode);  
                    }  
                    RadTreeView1.CheckBoxes = true;  
                    ArrayList diffcolumn = (ArrayList)Session["DiffColumn"];  
 
                       if (diffcolumn != null)  
                    {  
                        foreach (string node in diffcolumn)  
                        {  
                            RadTreeNode nodetext = RadTreeView1.FindNodeByText(node);  
                            nodetext.Checked = false;  
 
                        }  
                    }  
                    else {  
 
                        foreach (string node in colum)  
                        {  
                            RadTreeNode nodetext = RadTreeView1.FindNodeByText(node);  
                            nodetext.Checked = true;  
 
                        }  
                    }  
            }  
        }  
 
        protected void Button1_Click(object sender, EventArgs e)  
        {  
                           StringBuilder temp = new StringBuilder();  
                StringBuilder order = new StringBuilder();  
 
                CRUDActivitiesBL objInsert = new CRUDActivitiesBL();  
 
                object[] arrSpParameters = new object[3];  
 
                foreach (RadTreeNode node in RadTreeView1.GetAllNodes())  
                {  
 
 
 
                    if (node.Checked == true)  
                    {  
 
                        order.Append(node.Text.Trim());  
                        order.Append("#");  
 
                    }  
 
                    else 
                    {  
 
                        temp.Append(node.Text.Trim());  
                        temp.Append("#");  
 
                    }  
 
                }  
                if (order.Length > 0)  
                {  
 
                    order.Remove(order.Length - 1, 1);  
                }  
                if (temp.Length > 0)  
                {  
                    temp.Remove(temp.Length - 1, 1);  
                }  
                arrSpParameters[0] = 21;  
                arrSpParameters[1] = "Prospect";  
                arrSpParameters[2] = temp.ToString();  
                int result = CRUDActions("GetRights", arrSpParameters);  
              
 
 
            ClientScript.RegisterStartupScript(Page.GetType(), "mykey""CloseAndRebind();"true);  
        }  
 
        protected void RadTreeNodeDrop(object sender, RadTreeNodeDragDropEventArgs e)  
        {  
            RadTreeNode sourceNode = e.SourceDragNode;  
            RadTreeNode destNode = e.DestDragNode;  
            RadTreeViewDropPosition dropPosition = e.DropPosition;  
 
            if (destNode != null)//drag&drop is performed between trees  
            {  
                if (sourceNode.Equals(destNode) || sourceNode.IsAncestorOf(destNode))  
                {  
                    return;  
                }  
                sourceNode.Owner.Nodes.Remove(sourceNode);  
 
                switch (dropPosition)  
                {  
                    //case RadTreeViewDropPosition.Over:  
                    //    // child  
                    //    if (!sourceNode.IsAncestorOf(destNode))  
                    //    {  
                    //        destNode.Nodes.Add(sourceNode);  
                    //    }  
                    //    break;  
 
                    case RadTreeViewDropPosition.Above:  
                          
                        destNode.InsertBefore(sourceNode);  
                                                break;  
 
                    case RadTreeViewDropPosition.Below:  
                                                destNode.InsertAfter(sourceNode);  
 
                                               break;  
                }  
            }  
        }  
 
 

Configure.aspx;

<div>  
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
         
          
         <script type="text/javascript">  
        function CloseAndRebind()  
        {  
          
                 
            GetRadWindow().Close();  
            GetRadWindow().BrowserWindow.refreshGrid();  
        }  
          
        function GetRadWindow()  
        {  
            var oWindow = null;  
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog  
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)  
                  
            return oWindow;  
        }  
 
 
 
          
        </script>  
     </telerik:RadCodeBlock>  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager>  
        <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />  
          
          
         
        
        <telerik:RadTreeView ID="RadTreeView1"  EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="true" OnNodeDrop="RadTreeNodeDrop" runat="server">  
        </telerik:RadTreeView>  
          
          
    </div> 

Sebastian
Telerik team
 answered on 13 Jan 2009
2 answers
178 views
I have two dates.
I assign these dates as the minimum & maximum dates of the date picker.
I want to disable all other dates less than the min date & greater than the max dates.
Plz help
Daniel
Telerik team
 answered on 13 Jan 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?