This is a migrated thread and some comments may be shown as answers.

Grid Drag and Select problem.

1 Answer 84 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Het asked on 16 Sep 2008, 02:19 PM
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" />
                                <Selecting EnableDragToSelectRows="true" AllowRowSelect="true" />
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            <MasterTableView ShowHeader="true" CellPadding="0" CellSpacing="0" BorderWidth="0px">
                                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" Visible="false">
                                    <telerik:GridTemplateColumn HeaderText="Description" UniqueName="TaskNbr" HeaderStyle-HorizontalAlign="Center"  ItemStyle-HorizontalAlign="Center"   ItemStyle-VerticalAlign="Top" >
                                        <table width="98%" cellpadding="0" cellspacing="0" style="border:0px">
                                                    <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>
                                        <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>
                                        <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">
                                                    <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>
                                <EditFormSettings EditFormType="WebUserControl"  FormMainTableStyle-Height="100%" UserControlName="../Controls/StatusTaskDetails.ascx">
                                    <EditColumn UniqueName="TaskEdit">
                            <SelectedItemStyle BorderStyle="None" />

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

Thanks in advance for your help.

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 19 Sep 2008, 11:09 AM
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:


Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question