<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AssignInvoices.aspx.cs" Inherits="iConnect.InvoicesScaling.Views.AssignInvoices" Title="AssignInvoices" MasterPageFile="~/Shared/Silver.master" %> <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <asp:Content ID="content" ContentPlaceHolderID="DefaultContent" runat="Server"> <script src="../Shared/js/jquery-1.6.2.min.js" type="text/javascript"></script> <script src="../Shared/js/jquery.tooltip.js" type="text/javascript"></script> <script type="text/javascript" src="../Silverlight.js"></script> <h1 style="text-align: center;"> Assign Invoices</h1> <br /> <table> <tr> <td> <telerik:RadListBox ID="RadListBox1" runat="server" AllowReorder="True" Skin="Black" Sort="Ascending" Height="400px" Width="250px" EnableDragAndDrop="True"> <ButtonSettings TransferButtons="All"></ButtonSettings> <HeaderTemplate> <h5 style="color: White; text-align: center"> USERS</h5> </HeaderTemplate> </telerik:RadListBox> </td> <td> <telerik:RadListBox ID="RadListBox2" runat="server" SelectionMode="Multiple" EnableDragAndDrop="True" Height="400px" Width="150px" AllowReorder="True" Skin="Black"> <ButtonSettings TransferButtons="All"></ButtonSettings> <HeaderTemplate> <h5 style="color: White; text-align: center"> GROUPS</h5> </HeaderTemplate> </telerik:RadListBox> </td> <td> <telerik:RadListBox ID="RadListBox3" runat="server" EnableDragAndDrop="True" Height="400px" Width="150px" AllowReorder="True" Skin="Black"> <ButtonSettings TransferButtons="All"></ButtonSettings> <HeaderTemplate> <h5 style="color: White; text-align: center"> STAGING</h5> </HeaderTemplate> </telerik:RadListBox> </td> <td> <telerik:RadButton ID="RadButton1" runat="server" Text="Assign" Skin="Black" Width="100px" Height="50px" OnClick="RadButton1_Click"> </telerik:RadButton> <br /> <br /> <telerik:RadButton ID="RadButton2" runat="server" Text="Unassign" Skin="Black" Width="100px" Height="50px" OnClick="RadButton2_Click"> </telerik:RadButton> </td> <td> </td> <td> </td> <td> <h1> Total Invoices Resume </h1> <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Windows7"> </telerik:RadGrid> </td> </tr> <tr> <td> </td> <tr> <td> </td> <td> <telerik:RadGrid ID="RadGrid2" runat="server" Skin="Windows7"> </telerik:RadGrid> <h1> Total Invoices Resume </h1> <telerik:RadGrid ID="RadGrid3" runat="server" Skin="Windows7"> </telerik:RadGrid> </td> </tr> </tr> </table> <br /> <br /> </asp:Content>
the folowing is my drag and drop code behind but the problem is that every row drags and drops and works except for the last row in the grid. Is there something I need to change or do differnetly to get the last row to drag and drop.
Protected Sub myGridPErsonnel_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles myGridPErsonnel.RowDrop If e.DestDataItem.OwnerTableView.ClientID = myGridPositions.MasterTableView.ClientID Then For i As Integer = 0 To e.DraggedItems.Count - 1 Dim SSN As String = e.DraggedItems(i).GetDataKeyValue("SSN") Dim PositionId As Integer = e.DestDataItem.GetDataKeyValue("intPositionId") HFSSN.Value = SSN HFPosition.Value = PositionId FillInfo(SSN, PositionId) pnlPersonnelInfo_POP.Show() Next End If End Sub<telerik:GridTemplateColumn HeaderStyle-Width="100" HeaderText="Min Distance" UniqueName="MinDistance"> <ItemTemplate> <telerik:RadNumericTextBox ID="rntbMinDistance" Type="Number" MinValue="0" MaxLength="4" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" Width="40" DbValue='<%# Eval("MinDistanceToLocation") %>' Enabled='<%# Eval("IsIncludedInOrder") %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderStyle-Width="100" HeaderText="Max Distance" UniqueName="MaxDistance"> <ItemTemplate> <telerik:RadNumericTextBox ID="rntbMaxDistance" Type="Number" MinValue="0" MaxLength="4" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" Width="40" DbValue='<%# Eval("MaxDistanceToLocation") %>' Enabled='<%# Eval("IsIncludedInOrder") %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderStyle-Width="100" HeaderText="Min HSGY" UniqueName="MinHSGY"> <ItemTemplate> <asp:TextBox ID="txtMinHSGY" Type="Number" Width="40" Text='<%# Eval("MinHighSchoolGraduationYear") %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderStyle-Width="100" HeaderText="Max HSGY" UniqueName="MaxHSGY"> <ItemTemplate> <asp:TextBox ID="txtMaxHSGY" Type="Number" Width="40" Text='<%# Eval("MaxHighSchoolGraduationYear") %>' runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn><telerik:RadInputManager ID="RadInputManager1" runat="server" > <telerik:NumericTextBoxSetting BehaviorID="hsgyBehavior" InitializeOnClient="false" ErrorMessage="Valid year is required" Type="Number" DecimalDigits="0" MinValue="1900" MaxValue="2099" > <TargetControls> <telerik:TargetInput ControlID="txtTest" /> </TargetControls> </telerik:NumericTextBoxSetting></telerik:RadInputManager>protected void rgrdLocations_ItemCreated(object sender, GridItemEventArgs e){ if (e.Item is GridDataItem && e.Item.IsDataBound && e.Item.DataItem != null) { NumericTextBoxSetting hsgySetting = (NumericTextBoxSetting)RadInputManager1.GetSettingByBehaviorID("hsgyBehavior"); TextBox txtMinHSGY = e.Item.FindControl("txtMinHSGY") as TextBox; TextBox txtMaxHSGY = e.Item.FindControl("txtMaxHSGY") as TextBox; hsgySetting.TargetControls.Add(new TargetInput(txtMinHSGY.UniqueID, true)); hsgySetting.TargetControls.Add(new TargetInput(txtMaxHSGY.UniqueID, true)); }}
Scenario:
I am developing an application using Telerik RadControls for ASPX.NET AJAX. I have tree
different Rad controls in the main page. A RadTreeview, a RadTabStrip and a RadGrid.
The basic functionality is: I select a node from the Treeview, that builds dynamic questions sourced from a database) in the RadTabStrip. And the answer to those questions is given by
selection an option in the single column RadGrid.
My questions are:
1. How can I set a default selection in the RadGrid?
2. When a node is selected the RadTabStrip is rebuilt but the page always blinks. How can I
avoid that blinking from the whole page running some server side code like the example here: http://demos.telerik.com/aspnet-classic/treeview/Examples/Programming/ServerSideApi/DefaultCS.aspx?
3. After a node selection and rebuilding the tabstrip pages, the RadTreeView loses the selected node focus. How can I keep the focus on the previously selected node? (it has something to do with that blink, can it be from the PostBack of the page?)
4. How can I load the grid having for each row a value and a text (value is an id related to the text element)?
Thank you all.
Regards
Bruno
