RadGrid in RadDock

7 posts, 0 answers
  1. 321 a
    321 a avatar
    8 posts
    Member since:
    Jan 2010

    Posted 19 Feb 2010 Link to this post

    Hi there,

    I've got a problem with a RadGrid in a RadDock.
    I already read some threads in the community an in the Knowledge Base:
    http://www.telerik.com/support/kb/aspnet-ajax/dock/placing-radgrid-in-a-dockable-object.aspx

    The thing is, that the RadGrid is already displayed in the RadDock.
    I would like to use additional attributes for the RadGrid. First of all here the code:
    <telerik:RadDockLayout EnableAjaxSkinRendering="true" EnableEmbeddedBaseStylesheet="true" EnableEmbeddedSkins="true" EnableViewState="true" runat="server" Visible="true"
    <telerik:RadDockZone runat="server" ID="RadDockZone3" Orientation="Vertical" Skin="Office2007" Width="100%"
    <telerik:RadDock ID="RadDock_abwesenheit" Title="Abwesenheiten" EnableEmbeddedBaseStylesheet="true" EnableEmbeddedSkins="true" runat="server" 
                        DockMode="Docked" EnableDrag="false" DefaultCommands="None"
    <TitlebarTemplate>       
    <div id="div_master_top_left" style="z-index: 100"
    Abwesenheiten 
      </div> 
      <div id="div_master_top_right" style="z-index: 101"
        <table width="100%"
          <tr align="center"
            <td align="center"
              <asp:LinkButton ID="adFav" runat="server" CssClass="content_element" ForeColor="Black" 
                Style="text-align: center; margin-top: 15px;" Text='<img style="border:0px;vertical-align:middle; text-align:center; " alt="" src="..\images\AddFav.gif" /> Zu Favoriten' 
                meta:resourcekey="adFavResource1"></asp:LinkButton> 
            </td> 
          </tr> 
        </table> 
      </div> 
     </TitlebarTemplate> 
    <ContentTemplate> 
      <%-- Grid --%> 
        <telerik:RadGrid ID="Grid_Rad" runat="server"  
            DataSourceID="ObjectDataSource_Abwesenheiten" GridLines="Both"  
            meta:resourcekey="Grid_RadResource1" AutoGenerateColumns="False" Width="100%"
     
           <HeaderContextMenu EnableTheming="True"
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
          </HeaderContextMenu> 
          <GroupPanel ID="GroupPanel" Text="Gruppierungsfl&#228;che"
          </GroupPanel> 
          <ExportSettings FileName="Abwesenheit" OpenInNewWindow="True"
            <Pdf PaperSize="A4" PageHeight="210mm" PageWidth="297mm" /> 
          </ExportSettings> 
          <MasterTableView DataKeyNames="hr_m_abwesenheit_id" DataSourceID="ObjectDataSource_Abwesenheiten" 
            NoDetailRecordsText="Keine Daten vorhanden."  
                NoMasterRecordsText="Keine Daten vorhanden."
     
            <RowIndicatorColumn> 
              <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
              <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
            <Columns> 
                <%-- a lot of columns.... --%> 
            </Columns> 
            <CommandItemTemplate> 
              <div style="padding: 10px 0px; float: left"
                <asp:LinkButton ID="btnInitInsert" runat="server" CommandName="InitInsert" Visible='<%# (not (Grid_Rad.MasterTableView.IsItemInserted) and Grid_Rad.EditIndexes.Count = 0) and _allow_new %>' 
                  Text=' &lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\AddRecord.gif&quot; /&gt; Hinzuf&#252;gen' 
                  meta:resourcekey="btnInitInsertResource1"></asp:LinkButton> 
                <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" CausesValidation="False" 
                  Visible='<%# (Grid_Rad.EditIndexes.Count = 0 xor Grid_Rad.MasterTableView.IsItemInserted) and _allow_edit %>' 
                  Text=' &lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\Edit.gif&quot; /&gt; Ausgew&#228;hlte Daten bearbeiten ' 
                  meta:resourcekey="btnEditSelectedResource1"></asp:LinkButton> 
                <asp:LinkButton ID="btnEditAll" runat="server" CommandName="EditAll" CausesValidation="False" 
                  Visible='<%# (Grid_Rad.EditIndexes.Count = 0 xor Grid_Rad.MasterTableView.IsItemInserted) and _allow_edit %>' 
                  Text=' &lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\Edit.gif&quot; /&gt; Alle Daten bearbeiten ' 
                  meta:resourcekey="btnEditAllResource1"></asp:LinkButton> 
                <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# Grid_Rad.EditIndexes.Count > 0 %>' 
                  Text=' &lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\Update.gif&quot; /&gt; Speichern ' 
                  meta:resourcekey="btnUpdateEditedResource1"></asp:LinkButton> 
                <asp:LinkButton ID="btnDelete" OnClientClick="javascript:return confirm(document.getElementById('txt_delete_message').value)" 
                  runat="server" Visible='<%# (Grid_Rad.EditIndexes.Count = 0) and _allow_del %>' 
                  CommandName="DeleteSelected" CausesValidation="False" Text=' &lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\Delete.gif&quot; /&gt; Ausgew&#228;hlte Daten l&#246;schen ' 
                  meta:resourcekey="btnDeleteResource1"></asp:LinkButton> 
                <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" CausesValidation="False" 
                  Visible='<%# Grid_Rad.EditIndexes.Count > 0 xor Grid_Rad.MasterTableView.IsItemInserted %>' 
                  Text=' &lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\Cancel.gif&quot; /&gt; Abbrechen ' 
                  meta:resourcekey="btnCancelResource1"></asp:LinkButton> 
              </div> 
              <div style="padding: 10px 10px; float: right"
                <asp:LinkButton ID="btn_Excel" runat="server" OnClick="btn_Excel_Click" Text='&lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\xls.gif&quot; /&gt; Excel' 
                  CausesValidation="False" meta:resourcekey="btn_ExcelResource1"></asp:LinkButton> 
                <asp:LinkButton ID="btn_Word" runat="server" OnClick="btn_Word_Click" Text='&lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\doc.gif&quot; /&gt; Word' 
                  CausesValidation="False" meta:resourcekey="btn_WordResource1"></asp:LinkButton> 
                <asp:LinkButton ID="btn_pdf" Visible="False" runat="server" OnClick="btn_pdf_Click" 
                  Text='&lt;img style=&quot;border:0px;vertical-align:middle;&quot; alt=&quot;&quot; src=&quot;..\RadControls\Skins\Office2007\Grid\pdf.gif&quot; /&gt; PDF' 
                  CausesValidation="False" meta:resourcekey="btn_pdfResource1"></asp:LinkButton> 
              </div> 
            </CommandItemTemplate> 
            <EditFormSettings> 
              <EditColumn UniqueName="EditCommandColumn1"
              </EditColumn> 
            </EditFormSettings> 
          </MasterTableView> 
          <ClientSettings> 
            <Scrolling ScrollHeight="415px" AllowScroll="True" UseStaticHeaders="true" /> 
          </ClientSettings> 
          <FilterMenu EnableTheming="True"
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
          </FilterMenu> 
        </telerik:RadGrid> 
        <%--      </telerik:RadAjaxPanel>--%> 
        <!-- Grid DataSource --> 
        <asp:ObjectDataSource ID="ObjectDataSource_Abwesenheiten" runat="server" OldValuesParameterFormatString="original_{0}" 
          SelectMethod="Get_Data_Abwesenheit" TypeName="ProcessHRClassLibrary.BLL_Grundlagen"
          <SelectParameters> 
            <asp:SessionParameter Name="mandant_id" SessionField="hr_c_mandant_id" Type="Int32" 
              DefaultValue="" /> 
          </SelectParameters> 
        </asp:ObjectDataSource> 
        <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Height="75px" Transparency="40" 
          BackColor="#C3DAF9" Width="75px" meta:resourcekey="LoadingPanel1Resource1"
        </telerik:RadAjaxLoadingPanel> 
        <asp:ObjectDataSource ID="ObjectDataSource_Mandant" runat="server" OldValuesParameterFormatString="original_{0}" 
          SelectMethod="Get_Data_Mandant_without_own" TypeName="ProcessHRClassLibrary.BLL_Grundlagen"
          <SelectParameters> 
            <asp:SessionParameter Name="_mandant_id" SessionField="hr_c_mandant_id" Type="Int32" /> 
          </SelectParameters> 
        </asp:ObjectDataSource> 
        <asp:HiddenField ID="hid_mn_id" runat="server" /> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" meta:resourcekey="RadAjaxManager1Resource1"
        </telerik:RadAjaxManager> 
      <%-- </div> --%> 
       
      </ContentTemplate> 
      </telerik:RadDock> 
      </telerik:RadDockZone> 
      </telerik:RadDockLayout> 

    I am sorry about the unformated code.....
    The problem is at the top after the <telerik:RadGrid- tag.
    Here we have the following lines:
           <HeaderContextMenu EnableTheming="True"
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
          </HeaderContextMenu> 
          <GroupPanel ID="GroupPanel" Text="Gruppierungsfl&#228;che"
          </GroupPanel> 
          <ExportSettings FileName="Abwesenheit" OpenInNewWindow="True"
            <Pdf PaperSize="A4" PageHeight="210mm" PageWidth="297mm" /> 
          </ExportSettings> 

    These lines of code are not working.... In fact a lot of properties of a usually RadGrid are not working correctly. For example the user is not able so select one or more lines.
    I already tried a lot of ways to fix this problem, but now I don't have an other idea.

    Yours sincerely
  2. 321 a
    321 a avatar
    8 posts
    Member since:
    Jan 2010

    Posted 19 Feb 2010 Link to this post

    Here an update. If I don't have the tags with the RadDocks, the grid is working correctly. So the problem has to be in the RadDock
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. 321 a
    321 a avatar
    8 posts
    Member since:
    Jan 2010

    Posted 22 Feb 2010 Link to this post

    Nobody an idea?
  5. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 23 Feb 2010 Link to this post

    Hi,

    Could you please provide a sample code (or project) that could be easily run and demonstrates the problem? I could not run the code without modifications. So, I made some changes but this time was not able to observe any unexpected behavior. The modified code is pasted below.

    Please move the unneeded content outside of the dock  - the AjaxManager, the AjaxLoadingPanel, HiddenField, the DataSource. Basically the dock should only contain the grid. The problem might arise from the fact that the dock changes the ClientIDs of the controls placed within its content container (see attached screen-shot).

    .aspx
    <%@ 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">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
                <telerik:RadDockZone runat="server" ID="RadDockZone3" Orientation="Vertical" Skin="Office2007"
                    Width="400px">
                    <telerik:RadDock ID="RadDock_abwesenheit" Title="Abwesenheiten" EnableEmbeddedBaseStylesheet="true"
                        EnableEmbeddedSkins="true" runat="server" DockMode="Docked" EnableDrag="false"
                        DefaultCommands="None">
                        <TitlebarTemplate>
                            <div id="div_master_top_left" style="z-index: 100; float: left;">
                                Abwesenheiten
                            </div>
                            <div id="div_master_top_right" style="z-index: 101; float: left;">
                                <table width="100%">
                                    <tr align="center">
                                        <td align="center">
                                            <asp:LinkButton ID="adFav" runat="server" ForeColor="Black" Style="text-align: center;
                                                margin-top: 15px;" Text="LinkButton"></asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </TitlebarTemplate>
                        <ContentTemplate>
                            <%-- Grid --%>
                            <telerik:RadGrid ID="Grid_Rad" runat="server" GridLines="Both" Width="100%">
                                <HeaderContextMenu EnableTheming="True">
                                    <CollapseAnimation Type="InOutQuint" Duration="200"></CollapseAnimation>
                                </HeaderContextMenu>
                                <GroupPanel ID="GroupPanel" Text="Gruppierungsfläche">
                                </GroupPanel>
                                <ExportSettings FileName="Abwesenheit" OpenInNewWindow="True">
                                    <Pdf PaperSize="A4" PageHeight="210mm" PageWidth="297mm" />
                                </ExportSettings>
                                <MasterTableView NoDetailRecordsText="Keine Daten vorhanden." NoMasterRecordsText="Keine Daten vorhanden.">
                                    <RowIndicatorColumn>
                                        <HeaderStyle Width="20px" />
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn>
                                        <HeaderStyle Width="20px" />
                                    </ExpandCollapseColumn>
                                </MasterTableView>
                                <ClientSettings>
                                    <Scrolling ScrollHeight="415px" AllowScroll="True" UseStaticHeaders="true" />
                                </ClientSettings>
                                <FilterMenu EnableTheming="True">
                                    <CollapseAnimation Type="InOutQuint" Duration="200"></CollapseAnimation>
                                </FilterMenu>
                            </telerik:RadGrid>
                            <%-- </div> --%>
                        </ContentTemplate>
                    </telerik:RadDock>
                </telerik:RadDockZone>
            </telerik:RadDockLayout>
            <%--      </telerik:RadAjaxPanel>--%>
            <!-- Grid DataSource -->
            <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Height="75px" Transparency="40"
                BackColor="#C3DAF9" Width="75px">
            </telerik:RadAjaxLoadingPanel>
            <asp:HiddenField ID="hid_mn_id" runat="server" />
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            </telerik:RadAjaxManager>
        </div>
        </form>
    </body>
    </html>

    .cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    public partial class Grid_in_Dock : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Grid_Rad.DataSource = new string[] { "1", "2", "3", "4", "5", "6", "1", "2", "3", "4", "5", "6", "1", "2", "3", "4", "5", "6", "1", "2", "3", "4", "5", "6" };
            Grid_Rad.DataBind();
        }
    }



    Regards,
    Pero
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. 321 a
    321 a avatar
    8 posts
    Member since:
    Jan 2010

    Posted 23 Feb 2010 Link to this post

    Hi Pero,

    thank you for your answer. I am going to try this tommorrow, I have to do other things at the moment.

    I the mean time I also tried more solutions.
    For example the following:
                        <telerik:RadGrid ID="Grid_Rad" runat="server" ShowGroupPanel="True" DataSourceID="ObjectDataSource_Abwesenheiten" 
                            meta:resourcekey="Grid_RadResource1" MasterTableView-CommandItemDisplay="Top" 
                            AllowMultiRowSelection="True" ShowStatusBar="True" AutoGenerateColumns="true"

    With this the CommantItemTemplat is shown at the top, so if I set everything in the properties of the grid, it should work, but there must be an easier solution.

    I am currently working with Windows XP SP2. Here I have the IIS 5.1. Maybe this could be a problem to....

    Yours sincerely
    -

  7. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 26 Feb 2010 Link to this post

    Hello,

    In general there shouldn't  be any problems when placing a Grid inside a Dock. The Dock is an INamingContainer and this means that the ClientIDs of the controls placed inside will reflect the ClientID of the dock. This is the only thing I can think of that might cause problems.

    I tested some of the grid online demos by wrapping RadDock around the grid and I couldn't experience any problems. Everything is working fine. I have attached a sample project for you to test. Start Default.aspx

    In order to provide solution we need to be able to reproduce the problem locally. Could you please send source code (or sample project) that could be easily run without any modifications?

    Best wishes,
    Pero
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. 321 a
    321 a avatar
    8 posts
    Member since:
    Jan 2010

    Posted 26 Feb 2010 Link to this post

    Hi Pero,

    finnally I tried your solution in other parts of my project. I also had a hard time with other telerik components in relation to the RadDocks, that is what caused this delay.....

    In the mean time I find solutions or a reason for my problem. I have a webapplication that should look like a normal application with winforms. Because of this I have a lot components which are nested.
    If I use your code to in smaller applications there are less problems. Because of this I should think about a redesign. During my current plan for this project, I could be able to fix these problems.

    THank you very much for your assist!!!!!!!

    Yours sincerely
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017