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

I have a ajax Grid, and some template columns. 
I want to enable/disable other column if I change the combobox value. How can I do that?
How can I get the client_id of another Grid template item control?
I had try to add a literal control in javascript client side,  but the literal control can not updated because of Ajax.
How can I make this? please help. thanks.

Regards,
Paul.

                                    <telerik:GridTemplateColumn UniqueName="AreaSiteTemplateColumn" HeaderText="Area Site">
                                        <ItemTemplate>
                                            <%#DataBinder.Eval(Container.DataItem,"area_site")%>
                                        </ItemTemplate>
                                        <ItemStyle Width="180px" />
                                        <EditItemTemplate>
                                            <telerik:RadComboBox
                                                DataTextField="system_code_name"
                                                DataValueField="system_code_id"  
                                                EnableLoadOnDemand="False"
                                                MarkFirstMatch="false"
                                                ID="RadComboBoxAreaSite"
                                                OnClientSelectedIndexChanged="AreaSiteOnClientSelectedIndexChanged"
                                                runat="server" 
                                                SelectedValue='<%#Bind("area_site_id") %>'>
                                            </telerik:RadComboBox>
                                        </EditItemTemplate>
                                    </telerik:GridTemplateColumn>  

Script:

                function AreaSiteOnClientSelectedIndexChanged(sender, args) {               
                    var carparkId, comboUsageId;                           
                    var carpark, comboUsage;
                   
                    var item = args.get_item();

                        switch (sender.get_id())
                        {               
                            <asp:Literal ID="litFindControl" runat="server" />

                            default :

                            break;                   

                        }
                       
                    carpark = $find(carparkId);
                    comboUsage = $find(comboUsage);                       
                   
                    if (item.get_text() == "Above Ground")   
                    {
                        carpark.set_value("");
                        carpark.disable();
                       
                        comboUsage.enable();
                    }
                    else if (item.get_text() == "Caraprk")
                    {                       
                        carpark.enable();
                       
                        comboUsage.set_value();
                        comboUsage.disable(); 
                    }                    
                }

server side:
    protected void RadGridAboveGround_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {        
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            GridEditManager editMan = editedItem.EditManager;

            RadNumericTextBox txtNoOfCarpark = editedItem.FindControl("txtNoOfCarpark") as RadNumericTextBox;
            RadComboBox comboUsage = editedItem.FindControl("RadComboBoxPropertySector") as RadComboBox;
            RadComboBox comboAreaSite = editedItem.FindControl("RadComboBoxAreaSite") as RadComboBox;

            litFindControl.Text += " case \"" + comboAreaSite.ClientID + "\":" + Environment.NewLine;
            litFindControl.Text += " carparkId = \"" + txtNoOfCarpark.ClientID + "\";" + Environment.NewLine;
            litFindControl.Text += " comboUsageId = \"" + comboUsage.ClientID + "\";" + Environment.NewLine;
            litFindControl.Text += " break;" + Environment.NewLine;
        }
    }

Bodevain Svensson
Top achievements
Rank 1
 answered on 24 Nov 2008
2 answers
113 views
Greetings,

I have a RadToolbar with 6 buttons within itself, with 3 being Clientside and 3 Serverside.  The 3 Serverside work fantastic, and 1 clientside works well enough due that it don't matter if I postback or not.  The other two however open a RadWindow, so I need to stop the postback if possible.  I've set the return value for the click to be false, but I still get a postback.  I'm unsuer what to do with the toolbar anymore, so I thought I'd ask for suggestions.  Here is the code for the three buttons.

function onClientButtonClick1(sender, args)  
        {  
            var btn = args.get_item();  
            if (btn.get_commandName() == "VR") {  
                var shell = $("[id~='hfRequestUserID']");  
                var control = shell.get(0);  
                doViewResume(control.value);  
                return false;  
            }  
 
            if (btn.get_commandName() == "V") {  
                var shell = $("[id~='hfRequestUserID']");  
                var control = shell.get(0);  
                var oWnd = window.radopen("ViewReason.aspx?userID=" + control.value + "&mode=view""");  
                oWnd.center();  
                return false;  
            }  
 
            if (btn.get_commandName() == "DM") {  
                var shell = $("[id~='hfRequestUserID']");  
                var control = shell.get(0);  
                var oWnd = window.radopen("ViewReason.aspx?userID=" + control.value + "&mode=deny""");  
                oWnd.center();  
                return false;  
            }  
        } 

VR is the button I was commenting that it doesn't matter if it posts back or not since it opens another window also, but it's not a RadWindow, just a normal popup window.  Anyways, I'd much appreciate any help I could receive.  Thank you.

~ Chad
Chad Johnson
Top achievements
Rank 1
 answered on 24 Nov 2008
3 answers
96 views
Hi,

I have 2 problems:
1. Setting realfontsize codebehind not working, I just get pixels from 8-72 when viewing the page.
2. The Width property of EditorTool is not valid codebehind, but works when setting in designmode.


RadEditor newEditor = new RadEditor(); 
            newEditor.Skin = "Gray"
            newEditor.EnableEmbeddedSkins = false
            newEditor.EnableEmbeddedBaseStylesheet = false
            newEditor.Tools.AddRange(getTools()); 
            newEditor.RealFontSizes.Add(new EditorRealFontSize("1.7em")); 
            newEditor.RealFontSizes.Add(new EditorRealFontSize("1.5em")); 
            newEditor.RealFontSizes.Add(new EditorRealFontSize("1.3em")); 
            newEditor.RealFontSizes.Add(new EditorRealFontSize("1.1em")); 
            newEditor.RealFontSizes.Add(new EditorRealFontSize("1.0em")); 
            newEditor.RealFontSizes.Add(new EditorRealFontSize("0.9em")); 
            newEditor.RealFontSizes.Add(new EditorRealFontSize("0.8em")); 
 
... 
 
 
        private IEnumerable<EditorToolGroup> getTools() 
        { 
            IList<EditorToolGroup> toolGroups = new List<EditorToolGroup>(); 
            EditorToolGroup toolGroup = new EditorToolGroup(); 
            EditorTool groupItem; 
 
            groupItem = new EditorTool(); 
            groupItem.Name = "RealFontSize"
            groupItem.Text="Storlek"
            //groupItem.Width = "60px"; 
            toolGroup.Tools.Add(groupItem); 
 
            ... 
 
            toolGroups.Add(toolGroup); 
 
            return toolGroups.AsEnumerable(); 
        } 

Mattias
Top achievements
Rank 1
 answered on 24 Nov 2008
1 answer
101 views
It seems that the AlternatingItemStyle settings are only effective to items that are data bound on the server side. Is there anyway to get the alternating style to items added with client script on OnRowDataBound client event?

Thanks
Sebastian
Telerik team
 answered on 24 Nov 2008
1 answer
196 views
Hi,

I am having a few problems footers and group footers. I am developing using RadGrid Q3 2008, under Vista/Dot Net 3.5.and various browsers.

  1. First Issue - There are settings (per column) for Header/Item/Footer Style, but not for Group Footer. Some, but not all, style settings in footer style are reflected in the Group Footer. So for eaxample, the horizontal alignment is applied to the table footer and the group footer, but the Footer Font Style (bold=True) does not appear to affect the Group Footer.

    I would guess that for maximum flexibility, having a complete set of Group Footer Style settings independent of the Footer Style woudl be best.
  2. Using a grid sized 100% x 100%, with both footer and group footer enabled, Sometimes the grid is too wide for the browser window (and a horizontal scroll bar appears), the grid footer appears below the scroll bar - which just feels a little "not right".

    More to the point, the footer columns are not aligned with the rest of the grid The footer seems to be squeezed to fit the browser window, but the grid stretches out to the right. Interestingly as soon as I "group by" something, it all comes together properly. Ungrouping and the footer goes wrong again.
  3. When grid rows do not fill the available height, the grid footer remains fixed right at the bottom of the available space - with a big gap - maybe a touch fussy, but it would be nicer if the footer moved up under the last row of data in this case - or perhaps what I mean is that a footer arrangement which behaved more like the grid footer would be a nice alternative - the last row comprises the footer with grand totals, and it scrolls with the rest of the grid. There are further odd artefacts, using the default skin, and with a grid that is shorter and narrower than the available space, the unused space (belwo and to the right) is coloured grey, but the grid footer extends the full width of the space in white.
  4. Group footers and collapsed groups - it would be really helpful to be able change a setting so that the group footer does not disappear when the group is collapsed. That way the user sees 2 rows, the Group title, and underneath, the totals in the group footer - with no detail in-between. The alternative might be that the group footer and header are merged into one row when the group is collapsed - though this may give some problems when the group title stretches across several columns which have totals.
Pavel
Telerik team
 answered on 24 Nov 2008
1 answer
115 views
We have a page that houses 3 comboboxes, along with some custom controls that embed the Scheduler.  On Firefox, we are seeing CPU spikes up to 12% when the page loads.  On IE7 we are seeing a 25% spike, which lingers for 1-2 seconds.

Is there anything to speed up the load time and decrease the CPU load on IE7?  Why is there such a big difference between the two?

Thanks.

Vince
Simon
Telerik team
 answered on 24 Nov 2008
3 answers
84 views
it is very important for my project. i can remember that 2007.q4 still have OnClientModeChange client event. but when i use 2008.q1, i find OnClientModeChange client event disappear, even the doc still have it. in the q3, it is totally disappear. because of that it is so important for me, so i have question, why rad remove it? does the next version plan to support it? or do we have method to currect it?
Rumen
Telerik team
 answered on 24 Nov 2008
15 answers
333 views
Sir

I have a Page, say Page1.aspx.In it a radGrid and link button is placed
When I click on the linkbutton, a radwindow with a usercontrol is loaded.
ie,

in Page1.aspx

function

openRadWindowCustomSearch()

{

var oWnd = radopen("Custom_Search_Page.aspx", "RadWindow2" );

oWnd.setSize(700,550)

oWnd.center();

}

Inside Custom_Search_Page.aspx ,I placed a usercontrol ie,
in
 Custom_Search_Page.aspx

<

form id="form1" runat="server">

<div>

<uc1:CustomSearch id="uclCustomSearch" runat="server" />

</div>

</form>


That usercontrol contains a button
While clicking on tht button I want to rabind the grid in Page1

Thanks in advance

Svetlina Anati
Telerik team
 answered on 24 Nov 2008
8 answers
297 views
I have an invisible field (<telerik:GridBoundColumn .... Visible="false") in my grid.
When I use the edit button that field appear in the edit form.
Is there any way to make it dissapear from the edit form?
Thank you!
Daniel
Telerik team
 answered on 24 Nov 2008
5 answers
210 views
Seem to be seeing some unusual behavior with the RadSplitter, I've uploaded a video to demonstrate whats happening. but basically the jist of it is that when i collapse a pane and resize the window.. the RadSplitter no longer occupies 100% of the screen?? i dont think this was a problem before, but appears to be now, I believe we recently changed over from Q1 to Q2, so i dont know if this has anything to do with it, please find the link below to Youtube and the code on the aspx page in question, but this is occuring in another place in our program where we use the RadPane.

http://www.youtube.com/v/-bkJ_sFxTas

<%@ Page Language="C#" AutoEventWireup="true" Inherits="BusinessPort.WebUI.DataViewers.ProcessMapViewerPage"
    Codebehind="ProcessMapViewer.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Reference Page="../DocumentViewer.aspx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Agility UserSuite -
        <%=WindowTitle%>
    </title>
    <style type="text/css">
            html, body, form
            {
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow:inherit
            }
            
            </style>
    <link rel="stylesheet" type="text/css" href="<%=VirtualDirectory%>BusinessPortProcessMapViewer.css" />
    <link rel="stylesheet" type="text/css" href="<%=VirtualDirectory%>DataViewers.css" />

    <script type="text/javascript" src="<%=VirtualDirectory%>standard.js"></script>
    
    <script type="text/JavaScript">

            function ChangeImageOnRollover(controlName, onOrOff)
            {
                document.getElementById(controlName + "Left").innerHTML = "<img src=\"<%=VirtualDirectory%>Images/ViewerImages/PMButtonLeft_" + onOrOff + ".gif\" />";
                document.getElementById(controlName + "Middle").className = onOrOff == "off"?"PMnotselectedMiddleDown TabTextMedium InnerTabPadding NoWrap":"PMselectedMiddleDown TabTextMedium InnerTabPadding NoWrap";
                document.getElementById(controlName + "Right").innerHTML = "<img src=\"<%=VirtualDirectory%>Images/ViewerImages/PMButtonRight_" + onOrOff + ".gif\" />";
            }    
            
            // Automatically set the height of the TopPane.
            function SplitterLoaded(splitter, arg)  
            {  
                var pane = splitter.getPaneById('<%= TopPane.ClientID %>');  
                var height = pane.getContentElement().scrollHeight;    
                pane.set_height(height);  
            } 
    </script>

</head>

<body style="width: 100%; overflow:hidden;" onload="checkBrowserWidth();">

    <form id="uiProcessMapViewerMainForm" runat="server" method="post">
    <asp:ScriptManager ID="ScriptManager" runat="server" />
        <div id="ParentDivElement" style="height: 100%;" class = "ScreenOnly">
            <asp:Panel ID="RenderMain" runat="server"/>
            <telerik:RadSplitter ID="MainSplitter" runat="server" Height="100%" Width="100%"
            Orientation="Horizontal" Skin="Outlook" BorderWidth = "0" OnClientLoaded="SplitterLoaded" OnClientResized = "SplitterLoaded">
                <telerik:RadPane ID="TopPane" runat="server" Height="100" MinHeight="85" MaxHeight="150"
                Scrolling="none" BorderWidth="0px">
                    <asp:PlaceHolder ID="uiProcessMapHolderHeader" runat="server" />
                </telerik:RadPane>
            <telerik:RadSplitBar ID="RadsplitbarTop" runat="server" CollapseMode="Forward" EnableResize = "false" />
                <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500" BorderWidth="0px">
                <telerik:RadSplitter ID="NestedSplitter" runat="server" Skin="Outlook" LiveResize="true" Orientation = "horizontal" BorderWidth="0px" >
                    <telerik:RadPane ID="LeftPane" runat="server" Width="100%" height="40" MaxHeight = "40" MinHeight = "40" Scrolling = "none" BorderWidth="0px">
                        <asp:PlaceHolder ID="uiActionerColorsPlaceHolder" runat="server" />
                    </telerik:RadPane>
            <telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="none" BorderWidth="0px" EnableResize = "false" />
                    <telerik:RadPane ID="ContentPane" runat="server" BorderWidth="0px" Scrolling = "Y"/>
                    </telerik:RadSplitter>
                    </telerik:RadPane>
                </telerik:RadSplitter>
        </div>

    <%--Placeholder for Printing Process Maps--%>
    <asp:PlaceHolder ID="PrintOnly" runat="server"/>

    </form>
</body>
</html>
Tsvetie
Telerik team
 answered on 24 Nov 2008
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?