Happy New Year
I have a RadGrid and RadTreeview controls on a web form. Treeview displays list of documents which user can drop on RadGrid rows. I change the text of one of columns in grid from "Drop Here" to document dropped from the treeview using server side code.
I would like to place a validation using client side to stop user dropping another document on the same row. To achieve this I was checking for text "Drop Here" in the column where document was dropped and allow if the text is "Drop Here". I always get the text "Drop Here" although the text has been updated.
My ASPX and code behind are as below
Many thanks
I have a RadGrid and RadTreeview controls on a web form. Treeview displays list of documents which user can drop on RadGrid rows. I change the text of one of columns in grid from "Drop Here" to document dropped from the treeview using server side code.
I would like to place a validation using client side to stop user dropping another document on the same row. To achieve this I was checking for text "Drop Here" in the column where document was dropped and allow if the text is "Drop Here". I always get the text "Drop Here" although the text has been updated.
My ASPX and code behind are as below
Many thanks
GridDataItem dataItem = RadGrid1.MasterTableView.Items[RowNumber.Value];foreach (RadTreeNode node in e.DraggedNodes){ //AddRowToGrid(dt, node); dataItem["DocAssigned"].Text = node.Text;}<telerik:RadDockZone runat="server" ID="RadDockZone1" Orientation="Vertical" Height="300px" Width="875px" BorderStyle="None"> <telerik:RadDock runat="server" ID="RadDock1" Title="Vehicle Schedule" Height="300px" Width="875px"> <ContentTemplate> <telerik:RadGrid runat="server" ID="RadGrid1" Width="840px" Visible="true" AutoGenerateColumns="False" OnRowDrop="RadGrid1_RowDrop"> <MasterTableView Width="100%" DataKeyNames="CompletionDate,DocAssigned" ClientDataKeyNames="CompletionDate,DocAssigned"> <Columns> <telerik:GridBoundColumn UniqueName="CompletionDate" SortExpression="CompletionDate" DataField="CompletionDate" HeaderStyle-Width="85" HeaderText="Completed" DataFormatString="{0:dd/MM/yyyy}"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="DateDue" SortExpression="DateDue" DataField="DateDue" HeaderStyle-Width="85" HeaderText="Due" DataFormatString="{0:dd/MM/yyyy}"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="AgCompanyName" SortExpression="AgCompanyName" DataField="AgCompanyName" HeaderStyle-Width="250" HeaderText="Agent"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="DocName" SortExpression="DocName" DataField="DocName" HeaderStyle-Width="150" HeaderText="Document"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="LinkedTo" SortExpression="LinkedTo" DataField="LinkedTo" HeaderStyle-Width="80" HeaderText="Linked To"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="80" HeaderText="Doc Assigned" UniqueName="DocAssigned" SortExpression="DocAssigned" DataField="DocAssigned" > </telerik:GridBoundColumn> </Columns> <NoRecordsTemplate> <div style="height: 30px; cursor: pointer;"> No outstanding documents for this vehicle </div> </NoRecordsTemplate> </MasterTableView> <ClientSettings AllowRowsDragDrop="true"> <ClientEvents OnRowMouseOver="RowMouseOver" OnRowDragStarted="OnRowDragStarted" /> <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" /> </ClientSettings> </telerik:RadGrid> </ContentTemplate> </telerik:RadDock></telerik:RadDockZone><telerik:RadDockZone runat="server" ID="unprocessedDocumentsRadDockZone" Orientation="Vertical" Height="460px" Width="875px" BorderStyle="None"> <telerik:RadDock runat="server" ID="unprocessedDocumentsRadDock" Title="Unprocessed Documents" Height="460px" Width="875px"> <ContentTemplate> <table> <tr> <td valign="top"> <telerik:RadTreeView ID="RadTreeView1" runat="server" AllowNodeEditing="false" Height="400px" Width="200px" Style="border: 1px solid #CBE7F5;" EnableDragAndDrop="true" OnClientNodeClicked="onNodeClicked" OnNodeDrop="RadTreeView1_HandleDrop" OnClientNodeDropping="onNodeDropping" OnClientNodeDragging="onTreeViewDragging" OnNodeExpand="RadTreeView1_NodeExpand"> </telerik:RadTreeView> </td> <td valign="top"> <pdfviewer:ShowPdf ID="ShowPdf1" runat="server" BorderStyle="None" BorderWidth="0px" Height="400px" Width="680px" /> </td> </tr> </table> </ContentTemplate> </telerik:RadDock></telerik:RadDockZone>