Grid Drag and Select problem.

2 posts, 0 answers
  1. Het
    Het avatar
    31 posts
    Member since:
    Jun 2008

    Posted 16 Sep 2008 Link to this post

    Telerik Support,

    I have grid with 1 GridTemplateColumn. In that column I define a HeaderTemplate and an ItemTemplate. In ItemTemplate I have 2 tables. 1st table has 2 columns and 2nd table has few columns. I don't want to use the Groupexpression nor Hierarchy grid for the kind of display I want. Now the problem I have is when I do drag and select, I cannot start from anywhere in between, I have to start from the left most edge of the grid and leave the mouse at the right most edge of the grid. I am pasting the code snippet below. Is there a way to overcome this problem ?

    <telerik:RadGrid ID="gdDatelist" runat="server" AllowPaging="false" AllowSorting="True"
                                AllowMultiRowSelection="true" PageSize="7" AutoGenerateColumns="False" GridLines="None"
                                Width="100%" Height="450" Skin="My" EnableEmbeddedSkins="false" OnItemDataBound="gdDatelist_ItemDataBound"
                                CellPadding="0" CellSpacing="0" BorderStyle="None" ShowStatusBar="true" StatusBarSettings-LoadingText="Loading..."
                                StatusBarSettings-ReadyText="Done" OnCancelCommand="gdDatelist_CancelCommand">
                                <AlternatingItemStyle Width="100%" BorderStyle="None" />
                                <ItemStyle Width="100%" VerticalAlign="Top" BorderStyle="None" />
                                <ClientSettings>
                                    
                                    <Selecting EnableDragToSelectRows="true" AllowRowSelect="true" />
                                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                </ClientSettings>
                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                <MasterTableView ShowHeader="true" CellPadding="0" CellSpacing="0" BorderWidth="0px">
                                   
                                    <Columns>
                                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" Visible="false">
                                        </telerik:GridEditCommandColumn>
                                        <telerik:GridTemplateColumn HeaderText="Description" UniqueName="TaskNbr" HeaderStyle-HorizontalAlign="Center"  ItemStyle-HorizontalAlign="Center"   ItemStyle-VerticalAlign="Top" >
                                        <HeaderTemplate>
                                            <table width="98%" cellpadding="0" cellspacing="0" style="border:0px">
                                                    <tr>
                                                        <th width="10%">&nbsp;</th>
                                                        <th width="5%">Unit</th>
                                                        <th width="10%">Interval</th>
                                                        <th width="10%">CW Value</th>
                                                        <th width="10%">Tolerance</th>
                                                        <th width="10%">NextDate</th>
                                                        <th width="10%">Max Limit</th>
                                                        <th width="10%">Est. Date</th>
                                                        <th width="10%">Remaining</th>
                                                    </tr>
                                            </table>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <table width="100%" cellpadding="0" cellspacing="0"  style="border:0px" >
                                                <tr style="background-color:#eeeeee">
                                                    <td align="left">
                                                        <asp:Label ID="lblTaskNbr"  Font-Bold="true" runat="server" Text=""></asp:Label>
                                                      
                                                        - <asp:Label ID="lblDescription"  Font-Bold="false" runat="server" Text=""></asp:Label>
                                                        <div style="display:none">
                                                        <asp:TextBox ID="txtEnrtaskId" CssClass="HideLabel" runat="server" Width="0px" Height="0px"></asp:TextBox>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                            <table width="98%" cellpadding="0" cellspacing="0" style="border:0px">
                                                <tr style="border:0px">
                                                        <td width="10%" valign="top" align="left">
                                                            <asp:Label ID="lblMisc"  Font-Size="7pt" Font-Italic="true" runat="server" Text=""></asp:Label>
                                                            <asp:Label ID="lblOperatorActionFlag" runat="server" Font-Bold="true" Font-Underline="true"
                                                                ForeColor="Blue" CssClass="LabelHover"></asp:Label>
                                                            <telerik:RadToolTip ID="rToolTipOperatorActFlag" runat="server" TargetControlID="lblOperatorActionFlag"
                                                                AutoCloseDelay="9000" Animation="None" RelativeTo="Element" Position="MiddleRight"
                                                                Width="400px" Skin="Web20" Sticky="True">
                                                            </telerik:RadToolTip>
                                                        </td>
                                                        <td width="5%"><asp:Label ID="lblUnit"  Font-Bold="false" runat="server" Text=""></asp:Label></td>
                                                        <td width="10%"><asp:Label ID="lblInterval"  Font-Bold="True" ForeColor="Green"   runat="server" Text=""></asp:Label></td>
                                                        <td width="10%"><asp:Label ID="lblComplianceValue"  Font-Bold="false" runat="server" Text=""></asp:Label></td>
                                                        <td width="10%"><asp:Label ID="lblTolerance"  Font-Bold="false" runat="server" Text=""></asp:Label></td>
                                                        <td width="10%"><asp:Label ID="lblNextDate"  Font-Bold="false" runat="server" Text=""></asp:Label></td>
                                                        <td width="10%"><asp:Label ID="lblMaxLimit"  Font-Bold="false" runat="server" Text=""></asp:Label></td>
                                                        <td width="10%"><asp:Label ID="lblMinEstDate"  Font-Bold="false" runat="server" Text=""></asp:Label></td>
                                                        <td width="10%"><asp:Label ID="lblTimeRemaining"  Font-Bold="false" runat="server" Text=""></asp:Label></td>
                                                    </tr>
                                            </table>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    </Columns>
                                    <EditFormSettings EditFormType="WebUserControl"  FormMainTableStyle-Height="100%" UserControlName="../Controls/StatusTaskDetails.ascx">
                                        <EditColumn UniqueName="TaskEdit">
                                        </EditColumn>
                                    </EditFormSettings>
                                </MasterTableView>
                                <SelectedItemStyle BorderStyle="None" />
                            </telerik:RadGrid>



    I am binding the grid at runtime in code behind and also using the _ItemDataBound.

    Thanks in advance for your help.
    Het

  2. Kiara
    Kiara avatar
    309 posts
    Member since:
    Jul 2006

    Posted 19 Sep 2008 Link to this post

    Het, I suppose that the elements which are draggable/selectable are the RadGrid's column cells/rows and when you inject other control inside it will not trigger those actions. That is why when you have table wrapped inside template column you are able to select/drag where the table area ends.

    For more flexible layout (if that will help you more) try the global item template feature:

    http://localhost:8301/radcontrols_prometheus/Grid/Examples/GeneralFeatures/CardView/DefaultVB.aspx

    Kiara
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top