Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
121 views
I am trying to enable/disable some (treeview) context menu items when a user tries to open the menu but I struggle to find documentation showing the actual method/properties to use.

The documentation about OnClientShowing shows this code

<script type="text/javascript"
  function showContextMenu(menu, args) 
  {              
     var target = args.get_targetElement(); 
     if (target) 
     { 
        if (target.value == "") 
        args.set_cancel(true); 
     else 
        menu.get_items().getItem(1).disable(); 
     } 
}</script> 
<telerik:RadContextMenu 
   ID="RadContextMenu1" runat="server" 
   OnClientShowing="showContextMenu"
 <Items> 
   ... 
 </Items> 
</telerik:RadContextMenu>  

but when I try it it blows up and it looks like I should call args.get_menu()...

Any idea where I can find the right documentation please?

I use 2009 Q1

Regards

Eric






Eric
Top achievements
Rank 1
 answered on 11 Jul 2009
2 answers
121 views
Hi:
The following displays nothing... Q2 2008 library
Phil
<%@ Page Language="C#" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
<script runat="server"
</script> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadComboBox ID="cboReport" runat="server" Width="300px"  
            AutoPostBack="True" HighlightTemplatedItems="True"  
            CausesValidation="False" > 
            <ItemTemplate> 
                <asp:Label runat="server" style="font-weight: bold"><%# DataBinder.Eval(Container, "Attributes['DisplayText']") %></asp:Label><br /> 
                <asp:Label ID="Label1" runat="server" style="font-size: smaller;"><%# DataBinder.Eval(Container, "Attributes['About']") %></asp:Label><br /> 
            </ItemTemplate> 
            <Items> 
                <telerik:RadComboBoxItem runat="server" Value="0" Text="Item 0" DisplayText="Item 0" About="This is Item 0" /> 
                <telerik:RadComboBoxItem runat="server" Value="1" Text="Item 1" DisplayText="Item 1" About="This is Item 1" /> 
                <telerik:RadComboBoxItem runat="server" Value="2" Text="Item 2" DisplayText="Item 2" About="This is Item 2" /> 
                <telerik:RadComboBoxItem runat="server" Value="3" Text="Item 3" DisplayText="Item 3" About="This is Item 3" /> 
            </Items> 
        </telerik:RadComboBox> 
    </div> 
    </form> 
</body> 
</html> 
 

Phil
Top achievements
Rank 2
 answered on 11 Jul 2009
3 answers
184 views

I have a page that pops up a RadWindow when a button is clicked. Works fine in IE7, but in IE8, Opera 9.64 and Chrome the window will flash up for just a moment and then close. The following code samples illustrate the problem.

Parent window:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestApp.WebForm1" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!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 runat="server">  
  <title></title>  
  <script type="text/javascript">  
 
    function btnOpenRadWindow_onClick() {  
      var oManager = GetRadWindowManager();  
      oManager.open("WebForm2.aspx", "rwTest");  
    }  
 
    function ccbTest(sender, newText) {  
      // Do something here  
    }  
 
  </script> 
</head> 
<body> 
  <form id="form1" runat="server">  
  <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
  </telerik:RadScriptManager> 
  <div> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista" Behavior="Default" InitialBehavior="None" Left="" Top="" Style="display: none;" VisibleStatusbar="False">  
      <Windows> 
        <telerik:RadWindow ID="rwTest" runat="server" Behavior="Resize, Close, Move" Behaviors="Resize, Close, Move" InitialBehavior="None" NavigateUrl="WebForm2.aspx" ClientCallBackFunction="ccbTest" Modal="true" ReloadOnShow="True" Style="display: none;" VisibleStatusbar="False" ShowContentDuringLoad="False" AutoSize="true">  
        </telerik:RadWindow> 
      </Windows> 
    </telerik:RadWindowManager> 
    <button id="btnOpenRadWindow" onclick="btnOpenRadWindow_onClick()">Open Window</button> 
  </div> 
  </form> 
</body> 
</html> 
 

Popup window:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="TestApp.WebForm2" %> 
 
<!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 runat="server">  
  <title></title>  
  <script type="text/javascript">  
 
    function btnClose_onclick() {  
      var oWindow = GetRadWindow();  
      oWindow.argument = null;  
      oWindow.close(0);  
    }  
 
    function GetRadWindow() {  
      var oWindow = null;  
      if (window.radWindow)  
        oWindow = window.radWindow;  
      else if (window.frameElement.radWindow)  
        oWindow = window.frameElement.radWindow;  
      return oWindow;  
    }  
    
  </script> 
</head> 
<body> 
  <form id="form1" runat="server">  
  <div> 
    <button id="btnClose" onclick="return btnClose_onclick()" class="ButtonStandard">Cancel</button><br /> 
  </div> 
  </form> 
</body> 
</html> 
 

I'm sure I'm doing something wrong since your samples work in these other browsers, but I haven't been able to figure it out yet. Can you shed some light on this please?

John
John Mann
Top achievements
Rank 1
 answered on 10 Jul 2009
1 answer
136 views

Hey everyone,

I'm seeing an issue with the CustomFilteringColumn used on Detail Tables when the DefaultHierarchyExpanded property is set to true.  When I have filtering enabled and I expand each grid item separately, the filtering column correctly displays the drop down and the contents are rendered.  However, when setting the DefaultHierarchyExpanded = true and letting the grid do its own grid item expansion, the drop down does not display for the CustomFilteringColumn except for the last set of items expanded.  Even though our grid code is very customized, I've tried this set up in a couple of difference scenarios to pinpoint that it's not likely something strange that we're doing in our base code.  In investigating the markup of the actual rendered grid when the drop down does not display, it appears that the <td> tag is completely empty.  For convenience, I've provided our current CustomFilteringColumn code.

To reiterate; the column's drop down displays correctly for the first row, the MasterTableView items, but not for any of the grid rows underneath EXCEPT for the last item and its grid rows.  Could this be a creation issue where each subsequent drop down created actually overwrites the previous instance until only the last instantiated controls remain?

public class CustomFilteringColumn : GridBoundColumn 
    { 
        private RadComboBox list = new RadComboBox(); 
        #region Properties 
        public object ListDataSource 
        { 
            get { return list.DataSource; } 
            set 
            { 
                list.DataSource = value; 
                string selectedValue = list.SelectedValue; 
                list.DataTextField = DataKeyField; 
                list.DataValueField = DataValueField; 
                list.DataBind(); 
                list.SelectedValue = selectedValue; 
                int height = 17 * list.Items.Count; 
                if (height < 400) 
                { 
                    list.Height = Unit.Pixel(height); 
                } 
                else 
                { 
                    list.Height = Unit.Pixel(400); 
                } 
            } 
        } 
 
        public string DataKeyField 
        { 
            get 
            { 
                String s = (String)ViewState["DataKeyField"]; 
                return ((s == null) ? String.Empty : s); 
            } 
 
            set 
            { 
                ViewState["DataKeyField"] = value; 
            } 
        } 
 
        public string DataValueField 
        { 
            get 
            { 
                String s = (String)ViewState["DataValueField"]; 
                return ((s == null) ? String.Empty : s); 
            } 
 
            set 
            { 
                ViewState["DataValueField"] = value; 
            } 
        } 
        #endregion 
 
        //RadGrid calls this method when it initializes the controls inside the filtering item cells 
        protected override void SetupFilterControls(TableCell cell) 
        { 
            base.SetupFilterControls(cell); 
            cell.Controls.RemoveAt(0); 
 
            list.ID = "list" + this.DataField; 
            list.Skin = "Vista"
            list.Width = this.FilterControlWidth; 
            list.Height = Unit.Pixel(50); 
            list.NoWrap = true
 
            list.AutoPostBack = true
            list.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(list_SelectedIndexChanged); 
            cell.Controls.AddAt(0, list); 
            cell.Controls.RemoveAt(1); 
        } 
 
        public void CreateDataSource(DataTable table) 
        { 
            DataTable dt = new DataTable(); 
            dt.Columns.Add(this.DataKeyField); 
            if (!dt.Columns.Contains(this.DataValueField)) 
            { 
                dt.Columns.Add(this.DataValueField); 
            } 
            //add and empty row to the datatable as the default item in the drop-down... 
            DataRow dtRow = dt.NewRow(); 
            dtRow[DataKeyField] = ""
            dtRow[DataValueField] = ""
            dt.Rows.Add(dtRow); 
 
            Dictionary<stringobject> values = new Dictionary<string,object>(StringComparer.InvariantCultureIgnoreCase); 
            foreach (DataRow row in table.Rows) 
            { 
                if (!values.ContainsKey(row[DataKeyField].ToString())) 
                { 
                    dtRow = dt.NewRow(); 
                    dtRow[DataKeyField] = row[DataKeyField]; 
                    dtRow[DataValueField] = row[DataValueField]; 
                    values.Add(row[DataKeyField].ToString(), row[DataValueField]); 
                    dt.Rows.Add(dtRow); 
                } 
            } 
            this.ListDataSource = dt; 
        } 
 
 
        void list_SelectedIndexChanged(object sender, EventArgs e) 
        { 
            GridFilteringItem filterItem = (sender as RadComboBox).NamingContainer as GridFilteringItem; 
            if (this.DataType == System.Type.GetType("System.Int32") || 
                this.DataType == System.Type.GetType("System.Int16") || 
                this.DataType == System.Type.GetType("System.Int64")) 
            { 
                filterItem.FireCommandEvent("Filter"new Pair("EqualTo"this.UniqueName)); 
            } 
            else // treat everything else like a string 
                filterItem.FireCommandEvent("Filter"new Pair("Contains"this.UniqueName)); 
        } 
         
        //RadGrid calls this method when the value should be set to the filtering input control(s) 
        protected override void SetCurrentFilterValueToControl(TableCell cell) 
        { 
            base.SetCurrentFilterValueToControl(cell); 
            RadComboBox list = (RadComboBox)cell.Controls[0]; 
            list.SelectedValue = this.CurrentFilterValue; 
        } 
        //RadGrid calls this method to extract the filtering value from the filtering input control(s) 
        protected override string GetCurrentFilterValueFromControl(TableCell cell) 
        { 
            RadComboBox list = (RadComboBox)cell.Controls[0]; 
            return list.SelectedValue; 
        } 
        protected override string GetFilterDataField() 
        { 
            return this.DataField; 
        } 
 
        public override GridColumn Clone() 
        { 
            CustomFilteringColumn res = new CustomFilteringColumn(); 
            res.CopyBaseProperties(this); 
            return this
        } 
    } 

Adam
Top achievements
Rank 1
 answered on 10 Jul 2009
3 answers
230 views
Hello,

I have a RadGrid with a template column (contains 3 image buttons), when I click one of the buttons a RadWindow opens with fields to edit the respective entry. After the update the window should close and the grid refresh to show the changes (using an ajax request). However, the ajax request is fired but i don't see any changes (the changes are occuring as I do check for it manually in the database). Any ideas? Here's my setup:

Masterpage:
<asp:ScriptManager ID="ScriptManagerMaster" runat="server"
                </asp:ScriptManager> 
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
                </telerik:RadAjaxManager> 

Content page:
<asp:LoginView ID="LoginView1" runat="server"
        <LoggedInTemplate> 
            <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
                <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGridTarefas">  
                        <UpdatedControls>  
                            <telerik:AjaxUpdatedControl ControlID="RadGridTarefas" />  
                        </UpdatedControls>  
                    </telerik:AjaxSetting> 
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManagerProxy1"
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadGridTarefas" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManagerProxy> 
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
                <script type="text/javascript">  
                    function ShowEditForm(utiliz, id, priority, state, name, deadline, progress, notes, category, rowIndex) {  
                        var grid = $find('<%= this.LoginView1.FindControl("RadMultiPageMain").FindControl("PageViewTarefas").FindControl("RadGridTarefas").ClientID %>');  
          
                        var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();  
                        grid.get_masterTableView().selectItem(rowControl, true);  
                        var params = "utiliz=" + utiliz + "&id=" + id + "&priority=" + priority + "&state=" + state + "&name=" + name + "&deadline=" + deadline + "&progress=" + progress + "&notes=" + notes + "&category=" + category; 
                        window.radopen("EditTaskForm.aspx?" + params, "EditTaskDialog");  
                        return false;  
                    } 
                    function refreshGrid(arg) {  
                        $find("<%= RadAjaxManager.GetCurrent(this).ClientID %>").ajaxRequest("Rebind");  
                    }  
                </script> 
            </telerik:RadCodeBlock> 
         
            <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPageMain" SelectedIndex="0"
                <Tabs> 
                    <telerik:RadTab runat="server" PageViewID="PageViewTarefas" Selected="True" Text="Tarefas"
                    </telerik:RadTab> 
                    <telerik:RadTab runat="server" PageViewID="PageViewCategorias" Text="Categorias"
                    </telerik:RadTab> 
                    <telerik:RadTab runat="server" PageViewID="PageViewProjectos" Text="Projectos"
                    </telerik:RadTab> 
                    <telerik:RadTab runat="server" PageViewID="PageViewGrupos" Text="Grupos"
                    </telerik:RadTab> 
                    <telerik:RadTab runat="server" PageViewID="PageViewPesquisa" Text="Pesquisa"
                    </telerik:RadTab> 
                </Tabs> 
            </telerik:RadTabStrip> 
            <telerik:RadMultiPage ID="RadMultiPageMain" runat="server" SelectedIndex="0"
                <telerik:RadPageView ID="PageViewTarefas" runat="server" BackColor="White" Selected="True"
                    <telerik:RadGrid ID="RadGridTarefas" runat="server" AllowPaging="True"  
                        AllowSorting="True" DataSourceID="SqlDataSourceTasks"  
                        GridLines="None" Skin="Hay" ShowStatusBar="True"  
                        AutoGenerateColumns="False" onitemdatabound="RadGridTarefas_ItemDataBound"  
                        PageSize="20" onitemcreated="RadGridTarefas_ItemCreated"  
                        ondatabound="RadGridTarefas_DataBound"  
                        onneeddatasource="RadGridTarefas_NeedDataSource" > 
                         
                        <HeaderContextMenu> 
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </HeaderContextMenu> 
                         
                        <MasterTableView DataSourceID="SqlDataSourceTasks" CommandItemDisplay="Top" GridLines="Vertical"  
                            HierarchyDefaultExpanded="True"  
                             
                            datakeynames="id_tarefas_trfs,prioridade_tarefas_trfs,estado_tarefas_trfs,nome_tarefas_trfs,prazo_tarefas_trfs,progresso_tarefas_trfs,categoria_tarefas_trfs,notas_tarefas_trfs"
                             
                            <NoRecordsTemplate>Sem tarefas para visualizar...</NoRecordsTemplate> 
                             
                            <CommandItemSettings AddNewRecordText="Adicionar Tarefa" RefreshText="Actualizar Lista" /> 
                             
                            <Columns> 
                                <telerik:GridTemplateColumn UniqueName="TmpltColTaskValidImg"
                                    <ItemTemplate> 
                                        <asp:Image ID="ImageTaskValidate" runat="server" ImageUrl="~/images/cog_error.png" /> 
                                    </ItemTemplate> 
                                </telerik:GridTemplateColumn> 
                                 
                                <telerik:GridTemplateColumn HeaderText="Opções" UniqueName="TmpltColTaskCmds" DataType="System.Int32"  
                                    ForceExtractValue="Always"
                                    <ItemTemplate> 
                                        <asp:ImageButton ID="ImgCompleteButton" runat="server" BorderStyle="None"  
                                            BorderWidth="0px" ImageUrl="~/images/tick.png"  
                                            CommandName="TaskCommand" CommandArgument="CompleteTask" 
                                            CausesValidation="False" /> 
                                             
                                        <asp:ImageButton ID="ImgEditButton" runat="server" BorderStyle="None"  
                                            BorderWidth="0px" ImageUrl="~/images/pencil.png" CommandName="TaskCommand" CommandArgument="EditTask" /> 
                                             
                                        <asp:ImageButton ID="ImgDeleteButton" runat="server" BorderStyle="None" BorderWidth="0px"  
                                            ImageUrl="~/images/cross.png" CommandArgument="DeleteTask" CommandName="TaskCommand" /> 
                                             
                                        <asp:ImageButton ID="ImgAttachButton" runat="server" BorderStyle="None" BorderWidth="0px"  
                                            ImageUrl="~/images/attach.png" CommandName="TaskCommand" CommandArgument="TaskAnexos" /> 
                                             
                                    </ItemTemplate> 
                                     
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
                                     
                                    <ItemStyle Wrap="False" /> 
                                     
                                    </telerik:GridTemplateColumn> 
                                     
                                    <telerik:GridBoundColumn DataField="nome_tarefas_trfs" HeaderText="Tarefa"  
                                        UniqueName="ColTaskName"
                                         
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
                                    </telerik:GridBoundColumn> 
                                     
                                    <telerik:GridTemplateColumn HeaderText="Prioridade" UniqueName="TmpltColPriorityImg"
                                        <ItemTemplate><asp:Image ID="ImagePriority" runat="server" /></ItemTemplate
                                    </telerik:GridTemplateColumn> 
                                     
                                    <telerik:GridBoundColumn DataField="nome_estados_trfs" HeaderText="Estado" UniqueName="ColTaskState"
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
                                    </telerik:GridBoundColumn> 
                                     
                                    <telerik:GridDateTimeColumn DataField="prazo_tarefas_trfs" HeaderText="Prazo"  
                                        UniqueName="ColTaskDeadline"
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
                                    </telerik:GridDateTimeColumn> 
                                     
                                    <telerik:GridTemplateColumn HeaderText="Progresso" UniqueName="TmpltColProgBar"
                                        <ItemTemplate> 
                                            <telerik:RadSlider ID="RadSliderProgress" runat="server" Enabled="False"  
                                                    ItemType="Tick" ShowDecreaseHandle="False" ShowDragHandle="False"  
                                                    ShowIncreaseHandle="False" Skin="Telerik" Value="50" Width="100px"  
                                                    CausesValidation="False" TrackMouseWheel="False"  
                                                ToolTip="Progresso (%)"
                                            </telerik:RadSlider> 
                                        </ItemTemplate> 
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
                                    </telerik:GridTemplateColumn> 
                                     
                                    <telerik:GridTemplateColumn HeaderText="Prog. Estimado" UniqueName="TmpltColEstProgBar"
                                     
                                        <ItemTemplate> 
                                         
                                            <telerik:RadSlider ID="RadSliderEstProgress" runat="server" Enabled="False"  
                                                    ShowDecreaseHandle="False" ShowDragHandle="False" ShowIncreaseHandle="False"  
                                                    Skin="Telerik" Width="100px" CausesValidation="False" LiveDrag="False"
                                            </telerik:RadSlider> 
                                         
                                        </ItemTemplate> 
                                         
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
                                             
                                    </telerik:GridTemplateColumn> 
                                     
                                    <telerik:GridDateTimeColumn DataField="criado_tarefas_trfs" HeaderText="Criado"  
                                        UniqueName="ColTaskCreated"
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
                                    </telerik:GridDateTimeColumn> 
                                     
                                    <telerik:GridBoundColumn DataField="nome_utiliz" HeaderText="Autor"  
                                        UniqueName="ColTaskCreator"
                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 
                                    </telerik:GridBoundColumn> 
                                     
                                    <telerik:GridBoundColumn DataField="nome_apps_grupos" EmptyDataText="-"  
                                        HeaderText="Grupo" UniqueName="ColTaskGroup"
                                    </telerik:GridBoundColumn> 
                                     
                                    <telerik:GridBoundColumn DataField="cod_apps_projectos" EmptyDataText="-"  
                                        HeaderText="Projecto" UniqueName="ColTaskProject"
                                    </telerik:GridBoundColumn> 
                                     
                            </Columns> 
                             
                            <EditFormSettings EditFormType="Template"></EditFormSettings> 
                             
                            <PagerStyle NextPagesToolTip="Próximas Páginas"  
                                NextPageToolTip="Próxima Página"  
                                PagerTextFormat="Mudar Página: {4} &amp;nbsp;Apresentar página {0} of {1}, itens {2} to {3} of {5}."  
                                PrevPagesToolTip="Páginas Anteriores" PrevPageToolTip="Página Anterior" /> 
                             
                            <CommandItemTemplate> 
                                <asp:LinkButton ID="LnkAddTask" runat="server"><img style="border: none 0px #000000" alt="Adicionar Tarefa" src="images/add.png" /> Adicionar Tarefa</asp:LinkButton> 
                                <asp:LinkButton ID="LnkTaskHistory" runat="server"><img style="border: none 0px #000000" alt="Ver Historico" src="images/clock.png" /> Ver Historico</asp:LinkButton> 
                            </CommandItemTemplate> 
                        </MasterTableView> 
                         
                        <ClientSettings><Scrolling AllowScroll="True" UseStaticHeaders="True" /></ClientSettings
                         
                        <FilterMenu><CollapseAnimation Duration="200" Type="OutQuint" /></FilterMenu
                         
                        <StatusBarSettings LoadingText="Carregando..." ReadyText="Pronto" /> 
                         
                        <CommandItemStyle HorizontalAlign="Left" VerticalAlign="Middle" /> 
                         
                    </telerik:RadGrid> 
                     
                    <asp:SqlDataSource ID="SqlDataSourceTasks" runat="server"  
                        ConnectionString="<%$ ConnectionStrings:AppsConnectionString %>" 
                        SelectCommand="Proc_GetUserTasks"  
                        SelectCommandType="StoredProcedure"><SelectParameters><asp:Parameter DefaultValue="01" Name="userCod" Type="String" /></SelectParameters></asp:SqlDataSource></telerik:RadPageView> 
                <telerik:RadPageView ID="PageViewCategorias" runat="server" BackColor="White">categorias</telerik:RadPageView><telerik:RadPageView ID="PageViewGrupos" runat="server" BackColor="White" Height="16px">grupos</telerik:RadPageView><telerik:RadPageView ID="PageViewProjectos" runat="server" BackColor="White">projectos</telerik:RadPageView><telerik:RadPageView ID="PageViewPesquisa" runat="server" BackColor="White">pesquisa</telerik:RadPageView> 
            </telerik:RadMultiPage> 
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista"  
                Style="z-index: 7001" Behavior="Close" InitialBehavior="None" Modal="True"  
                Overlay="True" KeepInScreenBounds="True"
                <Windows> 
                    <telerik:RadWindow Skin="Vista"  ID="EditTaskDialog" runat="server"  
                        Title="Editar Tarefa" Height="620px" 
                        Width="750px" Left="" Modal="true" Overlay="True"  
                        ShowContentDuringLoad="False" Behavior="None" Behaviors="None"  
                        InitialBehavior="Pin" InitialBehaviors="Pin" ReloadOnShow="True"  
                        VisibleStatusbar="True" KeepInScreenBounds="True"  /> 
                </Windows> 
            </telerik:RadWindowManager> 
        </LoggedInTemplate> 
        <AnonymousTemplate> 
            Deve entrar na sua conta para viualizar as suas tarefas. 
        </AnonymousTemplate> 
    </asp:LoginView> 

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        //RadGrid grid = (RadGrid)((RadMultiPage)Page.FindControl("RadMultiPageMain")).PageViews[0].FindControl("RadGridTarefas"); 
        //grid. 
        //Session["gridSource"] =  
    } 
 
    protected void Page_PreRender(object sender, EventArgs e) 
    { 
        //RadGrid grid = LoginView1.FindControl("RadMultiPageMain").FindControl("PageViewTarefas").FindControl("RadGridTarefas") as RadGrid; 
        //string s = RadAjaxManager.GetCurrent(this.Page.Master.Page).ToString(); 
        //RadAjaxManager RadAjaxManager1 = ((RadAjaxManager)Page.Master.FindControl("RadAjaxManager1")); 
        //RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, grid); 
    } 
 
    protected void Page_Init(object sender, EventArgs e) 
    { 
        RadAjaxManager radajaxManager = (RadAjaxManager)this.Page.Master.FindControl("RadAjaxManager1"); 
        RadAjaxControl.AjaxRequestDelegate handler = new RadAjaxControl.AjaxRequestDelegate(this.RadAjaxManagerProxy1_AjaxRequest); 
        radajaxManager.AjaxRequest += handler; 
    } 
 
    protected void RadGridTarefas_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem dataItem = (GridDataItem)e.Item; 
            DataRowView dataItemData = (DataRowView)e.Item.DataItem; 
        } 
    } 
     
    protected void RadGridTarefas_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        //TaskOptionsCommand 
        if (e.CommandName.CompareTo("TaskCommand") == 0) 
        { 
            if (e.CommandArgument.ToString().CompareTo("CompleteTask") == 0) 
            { 
            } 
            else if (e.CommandArgument.ToString().CompareTo("EditTask") == 0) 
            { 
            } 
            else if (e.CommandArgument.ToString().CompareTo("DeleteTask") == 0) 
            { 
            } 
            else if (e.CommandArgument.ToString().CompareTo("TaskAnexos") == 0) 
            { 
            } 
        } 
    } 
     
    protected void RadGridTarefas_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem dataItem = (GridDataItem)e.Item; 
            ImageButton imgBut = (ImageButton)dataItem["TmpltColTaskCmds"].FindControl("ImgEditButton"); 
            //imgBut.Attributes["href"] = "#"; 
            string category = "0"
            if (!String.IsNullOrEmpty(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["categoria_tarefas_trfs"].ToString())) 
                category = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["categoria_tarefas_trfs"].ToString(); 
            imgBut.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}');"
                User.Identity.Name, 
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id_trfs"], 
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["prioridade_trfs"], 
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["estado_trfs"], 
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["nome_trfs"], 
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["prazo_trfs"], 
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["progresso_trfs"], 
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["notas_trfs"], 
                category, 
                e.Item.ItemIndex); 
        } 
    } 
 
    protected void RadAjaxManagerProxy1_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        RadGrid grid = (RadGrid)LoginView1.FindControl("RadMultiPageMain").FindControl("PageViewTarefas").FindControl("RadGridTarefas"); 
        if (e.Argument == "Rebind"
        { 
            //grid.MasterTableView.SortExpressions.Clear(); 
            //grid.MasterTableView.GroupByExpressions.Clear(); 
            grid.Rebind(); 
        } 
        else if (e.Argument == "RebindAndNavigate"
        { 
            grid.MasterTableView.SortExpressions.Clear(); 
            grid.MasterTableView.GroupByExpressions.Clear(); 
            grid.MasterTableView.CurrentPageIndex = grid.MasterTableView.PageCount - 1; 
            grid.Rebind(); 
        } 
    } 
    protected void RadGridTarefas_DataBound(object sender, EventArgs e) 
    { 
         
    } 
    protected void RadGridTarefas_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
 
    } 

RadWindow form:

<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadSliderProgresso"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadSliderProgresso" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <div> 
        <script type="text/javascript">  
            function CloseAndRebind(args) {  
                GetRadWindow().Close();  
                GetRadWindow().BrowserWindow.refreshGrid(args);  
            }  
  
            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 as well)  
  
                return oWindow;  
            }  
  
            function CancelEdit() {  
                GetRadWindow().Close();  
            }  
             
             
        </script> 
 
        <table align="center" style="border: 1px solid Black; width:61%;"
            <tr> 
                <td align="center" class="style2" colspan="2" valign="top"
                    <h3 style="text-align: center; background-color: #CCFFCC;">Tarefa</h3> 
                    <asp:Label ID="LblTaskName" runat="server"></asp:Label> 
                </td> 
                <td align="center" class="style2" rowspan="3" valign="top"
                    <h3 style="background-color: #CCFFCC">Notas</h3> 
                    <telerik:RadTextBox ID="RadTextBoxNotas" Runat="server"  
                        EmptyMessage="Tarefa não sem notas..." Rows="28" Skin="Hay" TextMode="MultiLine"  
                        Width="300px"
                    </telerik:RadTextBox> 
                </td> 
            </tr> 
            <tr> 
                <td align="center" class="style2" valign="top"
                    <h3 style="background-color: #CCFFCC">Prazo</h3> 
                    <telerik:RadCalendar ID="RadCalendar1" Runat="server"  
                        font-names="Arial,Verdana,Tahoma" forecolor="Black"  
                        style="border-color:#ececec" CultureInfo="Portuguese (Portugal)"  
                        EnableMultiSelect="False" SelectedDate="" ViewSelectorText="x"  
                        EnableMonthYearFastNavigation="False" PresentationType="Preview" Skin="Hay"
                    </telerik:RadCalendar> 
                </td> 
                <td align="left" valign="top"
                    <h3 style="text-align: center; background-color: #CCFFCC;">Categorias</h3> 
                    <telerik:RadTreeView ID="RadTreeView1" Runat="server"  
                        DataFieldID="id_tarefas_cats" DataFieldParentID="root_tarefas_cats"  
                        DataSourceID="SqlDataSourceCategorias" DataTextField="nome_tarefas_cats"  
                        DataValueField="id_tarefas_cats" Skin="Hay"  
                        LoadingMessage="Carregando ..." ToolTip="Categorias Definidas"  
                        ondatabound="RadTreeView1_DataBound"
                    </telerik:RadTreeView> 
                    <asp:SqlDataSource ID="SqlDataSourceCategorias" runat="server"  
                        ConnectionString="<%$ ConnectionStrings:DigitalGreenAppsConnectionString %>"  
                         
                        SelectCommand="SELECT [id_tarefas_cats], [utiliz_tarefas_cats], [nome_tarefas_cats], [root_tarefas_cats], [nivel_tarefas_cats] FROM [tarefas_categorias] WHERE ([utiliz_tarefas_cats] = @utiliz_tarefas_cats)"
                        <SelectParameters> 
                            <asp:QueryStringParameter Name="utiliz_tarefas_cats" QueryStringField="utiliz"  
                                Type="String" /> 
                        </SelectParameters> 
                    </asp:SqlDataSource> 
                </td> 
            </tr> 
            <tr> 
                <td class="style2" align="center" valign="top"
                    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
 
                        <script type="text/javascript"
                            function valueChange(sender, args) 
                            { 
                                $get("LblTaskProgress").innerHTML = sender.get_value(); 
                            } 
                        </script> 
 
                    </telerik:RadCodeBlock> 
                    <h3 style="background-color: #CCFFCC">Progresso</h3><br /> 
                    <telerik:RadSlider ID="RadSliderProgresso" runat="server" AutoPostBack="True" 
                        DecreaseText="Diminuir" DragText="Arrastar" IncreaseText="Aumentar"  
                        Skin="Telerik" ToolTip="Progresso" OnClientValueChange="valueChange"  
                        OnClientLoaded="valueChange"
                    </telerik:RadSlider> 
&nbsp;<asp:Label ID="LblTaskProgress" runat="server"></asp:Label>
                    <asp:HiddenField ID="HiddenFieldProg" runat="server" /> 
                </td> 
                <td align="center" valign="top"
                    <h3 style="background-color: #CCFFCC">Caracteristicas</h3> 
                    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"
 
                        <script type="text/javascript"
                            function estadosChanged(sender, args) 
                            { 
                                var val = sender.get_value(); 
                                var slider = $find('<%= RadSliderProgresso.ClientID %>'); 
                                 
                                if(val == 1) 
                                { 
                                    slider.set_value(100); 
                                    return false; 
                                } 
                                else if(val == 2 || val == 5) 
                                { 
                                    slider.set_value(0); 
                                    return false; 
                                } 
                                var hide = document.getElementById("<%= HiddenFieldProg.ClientID %>"); 
                                slider.set_value(parseInt(hide.value)); 
                                return false;                           
                            } 
                        </script> 
 
                    </telerik:RadCodeBlock> 
                    Prioridade 
                    <telerik:RadComboBox ID="RadComboBoxPriorities" Runat="server"  
                        LoadingMessage="Carregando..." Skin="Hay" Text="Prioridade"
                        <Items> 
                            <telerik:RadComboBoxItem runat="server" ImageUrl="~/images/exclamation.png"  
                                Text="Urgent" Value="6" /> 
                            <telerik:RadComboBoxItem runat="server" ImageUrl="~/images/flag_red.png"  
                                Text="Muito Alto" Value="5" /> 
                            <telerik:RadComboBoxItem runat="server" ImageUrl="~/images/flag_orange.png"  
                                Text="Alto" Value="4" /> 
                            <telerik:RadComboBoxItem runat="server" ImageUrl="~/images/flag_yellow.png"  
                                Text="Normal" Value="3" /> 
                            <telerik:RadComboBoxItem runat="server" ImageUrl="~/images/flag_green.png"  
                                Text="Baixo" Value="2" /> 
                            <telerik:RadComboBoxItem runat="server" ImageUrl="~/images/flag_blue.png"  
                                Text="Muito Baixo" Value="1" /> 
                        </Items> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                    </telerik:RadComboBox> 
                    Estado 
                    <telerik:RadComboBox ID="RadComboBoxEstados" Runat="server"  
                        DataSourceID="SqlDataSourceEstados" DataTextField="nome_estados_trfs"  
                        DataValueField="id_estados_trfs" LoadingMessage="Carregando..." Skin="Hay"  
                        Text="Estado" 
                        onclientselectedindexchanged="estadosChanged"
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                    </telerik:RadComboBox> 
                    <asp:SqlDataSource ID="SqlDataSourceEstados" runat="server"  
                        ConnectionString="<%$ ConnectionStrings:DigitalGreenAppsConnectionString %>"  
                        SelectCommand="SELECT [id_estados_trfs], [nome_estados_trfs] FROM [tarefas_estados]"
                    </asp:SqlDataSource> 
                </td> 
            </tr> 
            <tr> 
                <td class="style2" align="center" bgcolor="#3399FF" colspan="3"
                    <asp:LinkButton ID="LnkAcceptChanges" runat="server" Font-Bold="True"  
                        Font-Underline="False" ForeColor="White" onclick="LnkAcceptChanges_Click"><img style="border: none 0px #000000" alt="Editar" src="images/pencil.png" /> Editar</asp:LinkButton> 
&nbsp;&nbsp; <asp:LinkButton ID="LnkCancelChanges" runat="server" onclick="LnkCancelChanges_Click"  
                        Font-Bold="True" Font-Underline="False" ForeColor="White"><img style="border: none 0px #000000" alt="Editar" src="images/cross.png" /> Cancel</asp:LinkButton> 
                </td> 
            </tr> 
        </table> 
        </div> 
    <asp:SqlDataSource ID="SqlDataSourceEdit" runat="server"  
        ConnectionString="<%$ ConnectionStrings:AppsConnectionString %>"  
        SelectCommand="Proc_GetUserTasks"  
        SelectCommandType="StoredProcedure"  
        UpdateCommand="[dbo].[Proc_EditTask]"  
        UpdateCommandType="StoredProcedure"
        <SelectParameters> 
            <asp:QueryStringParameter DefaultValue="01" Name="userCod"  
                QueryStringField="utiliz" Type="String" /> 
        </SelectParameters> 
        <UpdateParameters> 
            <asp:QueryStringParameter Name="taskID" QueryStringField="id" Type="Int32" /> 
            <asp:ControlParameter ControlID="RadTreeView1" Name="taskCat"  
                PropertyName="SelectedValue" Type="Int32" /> 
            <asp:ControlParameter ControlID="RadSliderProgresso" Name="taskProg"  
                PropertyName="Value" Type="Int32" /> 
            <asp:ControlParameter ControlID="RadComboBoxPriorities" Name="taskPrio"  
                PropertyName="SelectedValue" Type="Int32" /> 
            <asp:ControlParameter ControlID="RadComboBoxEstados" Name="taskState"  
                PropertyName="SelectedValue" Type="Int32" /> 
            <asp:ControlParameter ControlID="RadTextBoxNotas" Name="taskNotes"  
                PropertyName="Text" Type="String" /> 
        </UpdateParameters> 
    </asp:SqlDataSource> 
    </form> 
</body> 

public partial class EditTaskForm : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        if (!Page.IsPostBack) 
        { 
            LblTaskName.Text = Request.QueryString["name"]; 
            RadComboBoxPriorities.SelectedValue = Request.QueryString["priority"]; 
            RadComboBoxEstados.SelectedValue = Request.QueryString["state"]; 
            DateTime date = DateTime.Parse(Request.QueryString["deadline"]); 
            RadCalendar1.SelectedDate = date; 
            RadCalendar1.RangeMinDate = date; 
            HiddenFieldProg.Value = Request.QueryString["progress"]; 
            RadSliderProgresso.Value = Convert.ToInt32(Request.QueryString["progress"]); 
            RadTextBoxNotas.Text = Request.QueryString["notes"]; 
        } 
    } 
 
 
    protected void LnkCancelChanges_Click(object sender, EventArgs e) 
    { 
        ClientScript.RegisterStartupScript(Page.GetType(), "mykey""CloseAndRebind();"true); 
    } 
    protected void RadTreeView1_DataBound(object sender, EventArgs e) 
    { 
        if (!String.IsNullOrEmpty(Request.QueryString["category"]) && Request.QueryString["category"].CompareTo("0") != 0) 
        { 
            RadTreeNode n = RadTreeView1.FindNodeByValue(Request.QueryString["category"], false); 
            n.Selected = true
            RadTreeNode p = null
            p = n.ParentNode; 
            while (p != null
            { 
                p.Expanded = true
                p = p.ParentNode; 
            } 
        } 
    } 
    protected void LnkAcceptChanges_Click(object sender, EventArgs e) 
    { 
        int result = SqlDataSourceEdit.Update(); 
 
        ClientScript.RegisterStartupScript(Page.GetType(), "mykey""CloseAndRebind();"true); 
    } 
    protected void RadSliderProgresso_ValueChanged(object sender, EventArgs e) 
    { 
    } 
 

I apologise for all the code.

Thanks in advance.
Andy F.
Top achievements
Rank 1
Iron
 answered on 10 Jul 2009
0 answers
104 views
I followed the instructions and have the following in my master page:

<telerik:RadTabStrip runat="server" ID="RadTabStrip1" DataSourceID="siteMapDataSource1" Skin="Office2007" OnClientLoad="SetSearchBoxLoc"/>  
                                    <PublishingNavigation:PortalSiteMapDataSource ID="siteMapDataSource1" Runat="server" 
                                                SiteMapProvider="CombinedNavSiteMapProvider" EnableViewState="true" 
                                                StartFromCurrentNode="true" StartingNodeOffset="0" ShowStartingNode="false" 
                                                TreatStartingNodeAsCurrent="false" TrimNonCurrentTypes="Heading"/> 

However, the tabs are not showing the child sites as drop downs and as I drill into the site, the tabs begin to stack up.

What am I doing wrong?
John Powell
Top achievements
Rank 1
 asked on 10 Jul 2009
2 answers
279 views
In previous version if you set enableViewState="false" paging still operated correctly.

In this most recent release if you set enabeViewState="false", the currentpageindex is never updated, and the pageindexchanged event is not fired.  If you enable viewstate does it store all the row data in viewstate?  The regular asp.net controls do, which is why we have trained ourselves to turn off viewstate for grid controls, because viewstate can get very large very quick...


Nicholas Walker
Top achievements
Rank 1
 answered on 10 Jul 2009
4 answers
155 views
Hi,

How can I change the grouping field text during runtime? To clarify the scenario, let's say the grid looks like this

ColA  ColB
1 2
3 4
2 5
....
From the program column names are changed and it looks like:

Column A     Column B
1 2
3 4
2 5

This is fine. The trouble comes when "Column A" is dragged for grouping. Grouping is done perfectly. The only concern I have is it is diplaying Grouping Field name as "ColA" rather than "Column A"

Can it be changed programmatically?

Any hint is deeply appreciated.

Thanks lot.

Milan G
Milan Gurung
Top achievements
Rank 1
 answered on 10 Jul 2009
1 answer
49 views
Hi,

 On previewing the demo editor here :-
http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx

 It seems as though it is not possible to navigate to the parent site to find images. Can you confirm if this is correct and if so, when will this functionality be available? Someone else has asked the question in this forum already, but the question has not been answered fully.

Thanks,
Jason.
Jason Brownhill
Top achievements
Rank 1
 answered on 10 Jul 2009
2 answers
233 views
Hi. I have a grid that's displaying a record for each day of the week, and under that record there are other records related to that day. What I need to do is set the font sizes to be different depending upon whether or not the record is displaying the week day. The problem I'm having is that I'm setting these types of properties (colors etc.) in the ItemDataBound event and the font property is read only there.

Thanks
William
Top achievements
Rank 1
 answered on 10 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?