Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
148 views
Hi,

I am using drag and drop into my radgrid. but dragged item not set to dropped items. but dropped item selected.

Please check my code and let me know what i have missed.

 <telerik:RadGrid ID="rgCustomhrfields" runat="server" Width="738px" HeaderStyle-Font-Bold="true"
                    HeaderStyle-HorizontalAlign="Center" >
                    <ValidationSettings CommandsToValidate="PerformInsert,Update" ValidationGroup="Validate" />
                    <ClientSettings AllowRowsDragDrop="true">
                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
                        <ClientEvents OnRowDropping="onRowDropping" />
                    </ClientSettings>
                    <MasterTableView CommandItemDisplay="Top" AllowMultiColumnSorting="true" AutoGenerateColumns="false"
                        AllowPaging="true" AllowSorting="true" EditMode="InPlace" DataKeyNames="CUST_HR_FLD_ID"
                        PagerStyle-Mode="NextPrevNumericAndAdvanced" ExpandCollapseColumn-ButtonType="ImageButton"
                        ExpandCollapseColumn-CollapseImageUrl="Picture/LegendImages/SingleMinus.gif"
                        ExpandCollapseColumn-ExpandImageUrl="Picture/LegendImages/SinglePlus.gif">
                        <NoRecordsTemplate>
                            <div style="text-align: center">
                                There are no records to display</div>
                        </NoRecordsTemplate>
                        <CommandItemSettings AddNewRecordText="Add Custom HR Fields" ShowRefreshButton="false" />
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                        </RowIndicatorColumn>
                        <Columns>
                            <telerik:GridDragDropColumn Visible="true">
                            </telerik:GridDragDropColumn>
                            <telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="ImageButton" ItemStyle-Wrap="false"
                                InsertText="Save" UpdateText="Save" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Top"
                                ItemStyle-Width="5px">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" Wrap="False" Width="5px">
                                </ItemStyle>
                            </telerik:GridEditCommandColumn>
                            <telerik:GridTemplateColumn UniqueName="Name" SortExpression="cust_hr_fld_name" HeaderText="Name">
                                <ItemStyle VerticalAlign="Top" />
                                <ItemTemplate>
                                    <asp:Label ID="lblName" runat="server" Text='<%#Eval("cust_hr_fld_name") %>' SkinID="NoBold">
                                    </asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadTextBox ID="rtbName" runat="server" Text='<%#Eval("cust_hr_fld_name") %>'
                                        MaxLength="40">
                                    </telerik:RadTextBox>
                                    <asp:Label ID="lblManName" runat="server" ForeColor="Red" Text="*<br/>"></asp:Label>
                                    <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="rtbName"
                                        Display="Dynamic" ValidationGroup="Validate" ErrorMessage="Please enter Name"></asp:RequiredFieldValidator>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="Type" SortExpression="CUST_HR_FLD_TYPE" HeaderText="Type">
                                <ItemStyle VerticalAlign="Top" />
                                <ItemTemplate>
                                    <asp:Label ID="lblType" runat="server" Text='<%#Eval("cust_hr_fld_type") %>' SkinID="NoBold">
                                    </asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Label ID="lblType" runat="server" Text='<%#Eval("CUST_HR_FLD_TYPE") %>' SkinID="NoBold"
                                        Visible="false">
                                    </asp:Label>
                                    <asp:Label ID="lblTypeList" runat="server" Text='<%#Eval("cust_hr_fld_type") %>'
                                        SkinID="NoBold" Visible='<%# IIf((TypeOf(Container) is GridDataInsertItem), "False", "True")%>'>>
                                    </asp:Label>
                                    <telerik:RadComboBox ID="rcbType" runat="server" Width="100px" SelectedValue='<%#Eval("cust_hr_fld_type") %>'
                                        Visible='<%# IIf((TypeOf(Container) is GridDataInsertItem), "True", "False")%>'>
                                        <Items>
                                            <telerik:RadComboBoxItem runat="server" Text="DATE" Value="DATE" />
                                            <telerik:RadComboBoxItem runat="server" Text="SELECTION" Value="SELECTION" />
                                            <telerik:RadComboBoxItem runat="server" Text="NUMBER" Value="NUMBER" />
                                            <telerik:RadComboBoxItem runat="server" Text="CURRENCY" Value="CURRENCY" />
                                            <telerik:RadComboBoxItem runat="server" Text="FREETEXT" Value="FREETEXT" />
                                        </Items>
                                    </telerik:RadComboBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="Display Order" SortExpression="DISPLAY_ORDER"
                                HeaderText="Display<br/>Order">
                                <ItemTemplate>
                                    <asp:Label ID="lblDisplayOrder" runat="server" Text='<%#Eval("DISPLAY_ORDER") %>'
                                        SkinID="NoBold">
                                    </asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox ID="rntbDisplayOrder" runat="server" Text='<%#Eval("DISPLAY_ORDER") %>'
                                        MaxLength="4" EnabledStyle-HorizontalAlign="Right">
                                    </telerik:RadNumericTextBox>
                                    <asp:Label ID="lblManDis" runat="server" ForeColor="Red" Text="*<br/>"></asp:Label>
                                    <asp:RequiredFieldValidator ID="rfvDisplayOrder" runat="server" ControlToValidate="rntbDisplayOrder"
                                        Display="Dynamic" ValidationGroup="Validate" ErrorMessage="Please enter Display Order"></asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemStyle HorizontalAlign="Right" VerticalAlign="Top" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="Active" SortExpression="active_flag" HeaderText="Active?">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkLblFlag" runat="server" Checked='<%# IIF( Eval("active_flag")is DBNull.value,"False",Eval("active_flag")) %>'
                                        onclick="return DoNotAllowToEdit('', this )" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:CheckBox ID="chkActive" runat="server" Checked='<%# IIF( Eval("active_flag")is DBNull.value,"False",Eval("active_flag")) %>' />
                                </EditItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ImageUrl="~/Picture/delete.ico"
                                Text="Delete" UniqueName="DeleteCommandColumn">
                                <HeaderStyle Width="5px" />
                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Center" Width="5px" />
                            </telerik:GridButtonColumn>
                        </Columns>
                      
                        <NestedViewSettings DataSourceID="sdsSelection">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="CUST_HR_FLD_ID" MasterKeyField="CUST_HR_FLD_ID" />
                            </ParentTableRelation>
                        </NestedViewSettings>
                        <NestedViewTemplate>
                            <telerik:RadGrid ID="rgSelectZone" runat="server" Width="300px" HeaderStyle-Font-Bold="true"
                                HeaderStyle-HorizontalAlign="Center" DataSourceID="sdsSelection" OnItemCommand="rgSelectZone_ItemCommand"
                                OnItemDataBound="rgSelectZone_ItemDataBound">
                                <ValidationSettings CommandsToValidate="PerformInsert,Update" ValidationGroup="Validate" />
                                <ClientSettings AllowRowsDragDrop="true">
                                    <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
                                </ClientSettings>
                                <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" AllowSorting="true"
                                    EditMode="InPlace" DataKeyNames="CUST_SEL_LIST_ID,CUST_HR_FLD_ID">
                                    <NoRecordsTemplate>
                                        <div style="text-align: center">
                                            There are no records to display</div>
                                    </NoRecordsTemplate>
                                    <CommandItemSettings AddNewRecordText="Add List of Values" ShowRefreshButton="false" />
                                    <Columns>
                                        <telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="ImageButton" ItemStyle-Wrap="false"
                                            InsertText="Save" UpdateText="Save" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Top"
                                            ItemStyle-Width="5px">
                                        </telerik:GridEditCommandColumn>
                                        <telerik:GridTemplateColumn HeaderText="List of Values" UniqueName="ListofValues"
                                            SortExpression="SEL_LIST_VALUE">
                                            <ItemTemplate>
                                                <asp:Label ID="lblListZone" runat="server" Text='<%#Eval("SEL_LIST_VALUE") %>' SkinID="NoBold">
                                                </asp:Label>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <telerik:RadTextBox ID="rtbListZone" runat="server" Text='<%#Eval("SEL_LIST_VALUE") %>'
                                                    MaxLength="60" Width="150px">
                                                </telerik:RadTextBox>
                                                <asp:Label ID="lblManList" runat="server" ForeColor="Red" Text="*<br/>"></asp:Label>
                                                <asp:RequiredFieldValidator ID="rfvListZone" runat="server" ControlToValidate="rtbListZone"
                                                    Display="Dynamic" ValidationGroup="Validate" ErrorMessage="Please enter List of Values"></asp:RequiredFieldValidator>
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ImageUrl="~/Picture/delete.ico"
                                            Text="Delete" UniqueName="DeleteCommandColumn">
                                            <HeaderStyle Width="5px" />
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Center" Width="5px" />
                                        </telerik:GridButtonColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </NestedViewTemplate>
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                    <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    </HeaderContextMenu>
                </telerik:RadGrid>

 <asp:SqlDataSource ID="sdsSelection" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnStr %>"
        ProviderName="System.Data.OracleClient" SelectCommand="SELECT
    cust_sel_list_id
    , sel_list_value
    , cust_hr_fld_id
FROM
    CUSTOM_HR_FIELD_SEL_LIST_VIEW
WHERE
    cust_hr_fld_id=:CUST_HR_FLD_ID
ORDER BY
    SEL_LIST_VALUE
        ">
        <SelectParameters>
            <asp:Parameter Name="CUST_HR_FLD_ID" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsCustomHrFields" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnStr %>"
        ProviderName="<%$ ConnectionStrings:MyConnStr.ProviderName %>" SelectCommand="SELECT
    cust_hr_fld_id
    , cust_hr_fld_type
    , display_order
    , cust_hr_fld_name
    , DECODE(active_flag
                , 'Y', 'True'
                , 'False')   active_flag   
FROM
    CLIENT_CUSTOM_HR_FIELDS_VIEW
WHERE
     grp_id =:P_GRP_ID">
        <SelectParameters>
            <asp:SessionParameter Name="P_GRP_ID" SessionField="grp_id" />
        </SelectParameters>
    </asp:SqlDataSource>


Vb code
----------

Protected Sub rgCustomhrfields_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles rgCustomhrfields.RowDrop
        Dim CustomOrders As IList(Of Order)
        CustomOrders = CustomFields
        Dim order As Order = GetOrder(CustomOrders, Convert.ToInt32(e.DestDataItem.GetDataKeyValue("CUST_HR_FLD_ID")))
        Dim destinationIndex As Integer = CustomOrders.IndexOf(order)

        If ((e.DropPosition = GridItemDropPosition.Above) _
                               AndAlso (e.DestDataItem.ItemIndex > e.DraggedItems(0).ItemIndex)) Then
            destinationIndex = (destinationIndex - 1)
        End If
        If ((e.DropPosition = GridItemDropPosition.Below) _
                AndAlso (e.DestDataItem.ItemIndex < e.DraggedItems(0).ItemIndex)) Then
            destinationIndex = (destinationIndex + 1)
        End If
        Dim ordersToMove As New List(Of Order)()
        For Each draggedItem As GridDataItem In e.DraggedItems
            Dim tmpOrder As Order = GetOrder(CustomOrders, Convert.ToInt32(e.DestDataItem.GetDataKeyValue("CUST_HR_FLD_ID")))
            If tmpOrder IsNot Nothing Then
                ordersToMove.Add(tmpOrder)
            End If
        Next
        For Each orderToMove As Order In ordersToMove
            CustomOrders.Remove(orderToMove)
            CustomOrders.Insert(destinationIndex, orderToMove)
        Next

        CustomFields = CustomOrders
        rgCustomhrfields.Rebind()
        '' e.DestDataItem.Selected = True
        Dim destinationItemIndex As Integer = destinationIndex - (rgCustomhrfields.PageSize * rgCustomhrfields.CurrentPageIndex)
        e.DestinationTableView.Items(destinationItemIndex).Selected = True
    End Sub

    Private Shared Function GetOrder(ByVal ordersToSearchIn As IEnumerable(Of Order), ByVal display_order As String) As Order
        For Each order As Order In ordersToSearchIn
            If order.CUST_HR_FLD_ID = display_order Then
                Return order
            End If
        Next
        Return Nothing
    End Function

    Protected Property CustomFields() As IList(Of Order)
        Get
            Try
                Dim obj As Object
                obj = Session("CustomFields_VB")
                'If obj Is Nothing Then
                obj = GetOrders()
                Session("CustomFields_VB") = obj
                'End If
                Return DirectCast(obj, IList(Of Order))
            Catch ex As Exception
                Session("CustomFields_VB") = Nothing
            End Try
            Return New List(Of Order)
        End Get
        Set(ByVal value As IList(Of Order))
            Session("CustomFields_VB") = value
        End Set
    End Property

    Protected Class Order
        Private _Name As String
        Private _Type As String
        Private _displayorder As Integer
        Private _Active As String
        Private _CUST_HR_FLD_ID As String
        Public Sub New(ByVal CustHRFieldID As String, ByVal Type As String, ByVal displayorder As Integer, ByVal Name As String, ByVal Active As String)
            _Name = Name
            _Type = Type
            _displayorder = displayorder
            _Active = Active
            _CUST_HR_FLD_ID = CustHRFieldID
        End Sub

        Public ReadOnly Property display_order() As Integer
            Get
                Return _displayorder
            End Get
        End Property

        Public ReadOnly Property cust_hr_fld_type() As String
            Get
                Return _Type
            End Get
        End Property
        Public ReadOnly Property cust_hr_fld_name() As String
            Get
                Return _Name
            End Get
        End Property

        Public ReadOnly Property active_flag() As String
            Get
                Return _Active
            End Get
        End Property

        Public ReadOnly Property CUST_HR_FLD_ID() As Integer
            Get
                Return _CUST_HR_FLD_ID
            End Get
        End Property
    End Class

    Protected Function GetOrders() As IList(Of Order)
        Dim Item As IList(Of Order) = New List(Of Order)()
        Try
            con.Open()
            Dim cmdtxt As String = " SELECT " & _
                                                           "  cust_hr_fld_id  " & _
                                                           ", cust_hr_fld_type " & _
                                                           ", display_order  " & _
                                                           ", cust_hr_fld_name " & _
                                                           ", DECODE(active_flag,'Y', 'True', 'False')active_flag    " & _
                                        " FROM " & _
                                                           " CLIENT_CUSTOM_HR_FIELDS_VIEW" & _
                                        " WHERE " & _
                                                            " grp_id= " & Session("grp_id")

            cmd = con.CreateCommand
            cmd.CommandText = cmdtxt
            CustDT.Load(cmd.ExecuteReader, Data.LoadOption.OverwriteChanges)
            Dim l_cust_hr_fld_id, l_cust_hr_fld_type, l_display_order, l_cust_hr_fld_name, l_active_flag As String
            For count = 0 To CustDT.Rows.Count - 1
                l_cust_hr_fld_id = CustDT.Rows(count)("cust_hr_fld_id").ToString
                l_cust_hr_fld_type = CustDT.Rows(count)("cust_hr_fld_type").ToString
                l_display_order = CustDT.Rows(count)("display_order").ToString
                l_cust_hr_fld_name = CustDT.Rows(count)("cust_hr_fld_name").ToString
                l_active_flag = CustDT.Rows(count)("active_flag").ToString
                Item.Add(New Order(l_cust_hr_fld_id, l_cust_hr_fld_type, l_display_order, l_cust_hr_fld_name, l_active_flag))
            Next
        Catch ex As Exception
            lblErrCustomFields.Text = "Error in Custom HR Fields. Please contact Administrator"
        Finally
            cmd.Dispose()
            con.Close()
        End Try
        Return Item
    End Function


I am using using same as telerik sample code. but it is not working.

I have attached image. please check

Please check and let me. it is very urgent.

Thanks,
Dhamu.
Dhamodharan
Top achievements
Rank 1
 asked on 07 Apr 2011
3 answers
128 views
If an unhandled exception occurs within the page that's loaded in the Telerik Window, how would we close the window and show the unhandled exception in the main page?

I understand that I can inject the javascript to close the window from the server side, but If I inject the script on the OnError handler on the page, the page never completes rendering and the javascript for closing the window never fires.

PS: Currently, we are using the Application_Error in Global.asax.cs to handle unhandled exceptions.
Marin Bratanov
Telerik team
 answered on 07 Apr 2011
1 answer
81 views
Hi,

I'm trying to implement the client side editing with server side updating but I'm running into a problem.  Our grid has two drop downs which need to be loaded with data from the database if the cell that contains the drop down is double clicked.  Are there any events that can be captured client side, or is there a way we can raise an event of our own to populate the drop down?

Another problem is that the second drop down's data is dependent on what is selected from the first drop down.  Would there be a way to load data from the database when an item is selected from the first drop down?  If we can't do this is there another way we can do batch that will fix all of these problems?
Daniel
Telerik team
 answered on 07 Apr 2011
1 answer
52 views
I have a ASP.NET website that allows the user to stay logged in for an indefinite time.  I am trying to show a certain page or non closable rad window etc. every 30 days.  Right now I put the code below in my Master Page. The problem is that this runs on every page and I am sure there is a better way to do this.  I would redirect them to a page that checked this on login but they do not login for each visit.  I thought there may be a way to use the Global.asax page.  Any thought would be greatly appreciated.
if( !IsPostBack)
        {
            // Show Must Read Message When Profile Message Column is set to "Show"
                if (Profile.Message == "Show")
                {
                    Response.Redirect("~/xProfileMessage.aspx");
                }
 
            // Show Update Profile Page Every 30 days
                int DaysSinceProfileUpdate = (DateTime.Now - Profile.LastUpdatedDate).Days;
                 
                if (DaysSinceProfileUpdate > 30)
                {
                    Response.Redirect("~/xEditProfileAuto.aspx");
                }
}
Marin Bratanov
Telerik team
 answered on 07 Apr 2011
2 answers
72 views
I was playing with the dashboard recently and trying to adapt it to an alternate datasource but after trying to track down a problem I was encountering I noticed that it's actually a problem in the Sales Dashboard example itself. When you click on a person's name the silverlight controls in the main content area all update based off of an employee id being access in the Javascript, but the silverlight controls don't update correctly on the first attempt.

Sales Dashboard Example

If you open up the example, you'll get metrics for the first peron in the list, Nancy. And the Representative Sales of that first pair of data points is $7,332 (first green bar). If you select the next person over (Andrew), you'll notice the Rep Sales total of that first green bar stays at $7,332, it doesn't update at all. But if you select Andrew again, it NOW updates and shows the correct value of $3,099. After playing with the code that drives this I came to the conclusion that although the content for the main panel is being updated via using AJAX, the page is not correctly updating the Id that is stored in Javascript for access by the silverlight controls.

My question is, given this problem (if I'm right) how would you fix it? I mean, aren't the examples supposed to show working demos ;-)
Iana Tsolova
Telerik team
 answered on 07 Apr 2011
1 answer
246 views
I have a RadGrid with 2 inner layers of details tables.

I set this.radGrid.MasterTableView.HierarchyDefaultExpanded = true; before rebinding my grid for the export but it only expands 1 inner details table. How to expand all inner details tables? Thanks,
Pooya
Top achievements
Rank 1
 answered on 07 Apr 2011
5 answers
285 views
I am trying to accomplish using a single Radgrid for 7 different tables.  (one aspx page)  I am also wrapping my datasource updates (CRUD) in a Property procedure.  It is working pretty well except for inserting a new row in a table.  My problem is that it is posting the update to the radgrid control and the database twice,  I have spent many hours trying to debug my problem using the call stack and various other methods and what I have determined is that when I press the Insert link button (in-place editing), it is running the Radgrid_InsertCommand procedure twice and I am going slowly mad trying to figure out why.  My code is attached,  This could be a real challenge for the telerik MVPs. (or not!)  Thanks in advance.  (if I could, I would award 1000 points - but that's another site ;->)
P.S.  The Delete and Update commands work just fine using this code.  The difference is the insert process is activated from a RadButton outside the grid.  My aspx file has only the OnInsert, OnDelete, OnUpdate Commands.and the various SQLDataSources  The grid columns are built dynamically in code behind depending on the table the user chooses.
Protected Sub rgDisplay_InsertCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles rgDisplay.InsertCommand
        Dim editeditem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim dataTbl As DataTable = Me.GridSource
        Dim newRow As DataRow = dataTbl.NewRow
  
            Try 'calculate the next record key
                cmd.CommandText = "SELECT MAX(CMT_REC_ID) FROM tblTSComments"
                cmd.Connection = conn
                conn.Open()
                intLastKey = Convert.ToInt16(cmd.ExecuteScalar().ToString)
                intLastKey += 1
            Finally
                conn.Close()
            End Try
  
            Dim newValues As Hashtable = New Hashtable
            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editeditem)
            Try
                For Each entry As DictionaryEntry In newValues
                    If entry.Key = "CMT_REC_ID" Then
                        newRow("CMT_REC_ID") = intLastKey
                    Else
                        newRow(entry.Key) = entry.Value
                    End If
                Next
                dataTbl.Rows.Add(newRow)
                Me.GridSource = dataTbl
            Catch ex As Exception
                ' Error message goes here
                e.Canceled = True
            End Try
    End Sub
Private Property GridSource As DataTable
        Get
            Dim obj As Object = Me.ViewState("_gvs")
            If (Not obj Is Nothing) Then
                Return CType(obj, DataTable)
            Else
                Dim intRpt As Integer = Request("Report")
                Select Case intRpt
                    Case 0 'Comments
                        adp.SelectCommand = New OleDbCommand("SELECT CMT_REC_ID, CMT_DESCRIPTION FROM tblTSComments", conn)
                        Dim cmtstbl As New DataTable
                        conn.Open()
                        Try
                            adp.Fill(cmtstbl)
                        Finally
                            conn.Close()
                        End Try
                        Me.ViewState("_gvs") = cmtstbl
                        Return cmtstbl
                    Case 1 'Teams
                        adp.SelectCommand = New OleDbCommand("SELECT CT_TEAM_REC_ID, CT_TEAM_NAME, CT_REPORTS_TO FROM tblControllerTeam", conn)
                        Dim teamTbl As New DataTable
                        conn.Open()
                        Try
                            adp.Fill(teamTbl)
                        Finally
                            conn.Close()
                        End Try
                        Me.ViewState("_gvs") = teamTbl
                        Return teamTbl
                    Case 2 'Status
                        adp.SelectCommand = New OleDbCommand("SELECT TCS_STATUS_CODE, TCS_DESCRIPTION FROM tblEmplStatus", conn)
                        Dim statusTbl As New DataTable
                        conn.Open()
                        Try
                            adp.Fill(statusTbl)
                        Finally
                            conn.Close()
                        End Try
                        Me.ViewState("_gvs") = statusTbl
                        Return statusTbl
                    Case 3 'PayPeriod
                        adp.SelectCommand = New OleDbCommand("SELECT PAYPERIOD, PAYPERIODNBR, PAYPERIODLOCKED, PAYPERIODLOCKEDDATE, PAYPERIODLOCKID FROM PayPeriods ORDER BY PAYPERIOD", conn)
                        Dim ppTbl As New DataTable
                        conn.Open()
                        Try
                            adp.Fill(ppTbl)
                        Finally
                            conn.Close()
                        End Try
                        Me.ViewState("_gvs") = ppTbl
                        Return ppTbl
                    Case 4 'Team Leader
                        adp.SelectCommand = New OleDbCommand("SELECT OPF_NTUSER_ID, OPF_FNAME, OPF_MINIT, OPF_LNAME, OPF_REGION FROM tblOpsFacilitator", conn)
                        Dim leadTbl As New DataTable
                        conn.Open()
                        Try
                            adp.Fill(leadTbl)
                        Finally
                            conn.Close()
                        End Try
                        Me.ViewState("_gvs") = leadTbl
                        Return leadTbl
                    Case 5 'Vacation and Pers Choice Available
                        adp.SelectCommand = New OleDbCommand("SELECT TTE_NTUSER_ID, TTE_SOCIAL_SECURITY_NBR, TTE_FNAME + ' ' + TTE_LNAME AS NAME, TTE_TOTL_VAC_AVAIL, TTE_TOTL_PERS_CHOICE_AVAIL FROM tblTCCTimeCardEmployees WHERE TTE_EMPL_STATUS = 'A' ORDER BY TTE_NTUSER_ID", conn)
                        Dim vacPCHTbl As New DataTable
                        conn.Open()
                        Try
                            adp.Fill(vacPCHTbl)
                        Finally
                            conn.Close()
                        End Try
                        Me.ViewState("_gvs") = vacPCHTbl
                        Return vacPCHTbl
                    Case 6 'Rates
                        adp.SelectCommand = New OleDbCommand("SELECT TTE_NTUSER_ID, TTE_SOCIAL_SECURITY_NBR, TTE_FNAME + ' ' + TTE_LNAME AS NAME, TTE_EMPL_CATEGORY, TTE_CALC_TIMESHEET, TTE_FIVE_PCNT_RATE, TTE_TEN_PCNT_RATE FROM tblTCCTimeCardEmployees WHERE TTE_EMPL_STATUS = 'A' ORDER BY TTE_NTUSER_ID", conn)
                        Dim rateTbl As New DataTable
                        conn.Open()
                        Try
                            adp.Fill(rateTbl)
                        Finally
                            conn.Close()
                        End Try
                        Me.ViewState("_gvs") = rateTbl
                        Return rateTbl
                End Select
            End If
        End Get
        Set(value As DataTable)
            Dim intRpt As Integer = Request("Report")
            Select Case intRpt
                Case 0 'Comments
                    Try
                        adp.SelectCommand = New OleDbCommand("SELECT CMT_REC_ID, CMT_DESCRIPTION FROM tblTSComments", conn)
                        Dim cmdBldr As OleDbCommandBuilder = New OleDbCommandBuilder(adp)
                        conn.Open()
                        adp.Update(value)
                    Catch ex As Exception
                        'Error during update, add code to locate error, reconcile and try again
                    Finally
                        conn.Close()
                    End Try
                Case 1 'Teams
                    Try
                        adp.SelectCommand = New OleDbCommand("SELECT CT_TEAM_REC_ID, CT_TEAM_NAME, CT_REPORTS_TO FROM tblControllerTeam", conn)
                        Dim cmdBldr As OleDbCommandBuilder = New OleDbCommandBuilder(adp)
                        conn.Open()
                        adp.Update(value)
                    Catch ex As Exception
                        'Error during update, add code to locate error, reconcile and try again
                    Finally
                        conn.Close()
                    End Try
                Case 2 'Status
                    Try
                        adp.SelectCommand = New OleDbCommand("SELECT TCS_STATUS_CODE, TCS_DESCRIPTION FROM tblEmplStatus", conn)
                        Dim cmdBldr As OleDbCommandBuilder = New OleDbCommandBuilder(adp)
                        conn.Open()
                        adp.Update(value)
                    Catch ex As Exception
                        'Error during update, add code to locate error, reconcile and try again
                    Finally
                        conn.Close()
                    End Try
                Case 3 'PayPeriod
                    Try
                        adp.SelectCommand = New OleDbCommand("SELECT PAYPERIOD, PAYPERIODNBR, PAYPERIODLOCKED, PAYPERIODLOCKEDDATE, PAYPERIODLOCKID FROM PayPeriods ORDER BY PAYPERIOD", conn)
                        Dim cmdBldr As OleDbCommandBuilder = New OleDbCommandBuilder(adp)
                        conn.Open()
                        adp.Update(value)
                    Catch ex As Exception
                        'Error during update, add code to locate error, reconcile and try again
                    Finally
                        conn.Close()
                    End Try
                Case 4 'Team Leader
                    Try
                        adp.SelectCommand = New OleDbCommand("SELECT OPF_NTUSER_ID, OPF_FNAME, OPF_MINIT, OPF_LNAME, OPF_REGION FROM tblOpsFacilitator", conn)
                        Dim cmdBldr As OleDbCommandBuilder = New OleDbCommandBuilder(adp)
                        conn.Open()
                        adp.Update(value)
                    Catch ex As Exception
                        'Error during update, add code to locate error, reconcile and try again
                    Finally
                        conn.Close()
                    End Try
                Case 5 'Vacation and Pers Choice Available
                    Try
                        adp.SelectCommand = New OleDbCommand("SELECT TTE_NTUSER_ID, TTE_SOCIAL_SECURITY_NBR, TTE_FNAME + ' ' + TTE_LNAME AS NAME, TTE_TOTL_VAC_AVAIL, TTE_TOTL_PERS_CHOICE_AVAIL FROM tblTCCTimeCardEmployees WHERE TTE_EMPL_STATUS = 'A' ORDER BY TTE_NTUSER_ID", conn)
                        Dim cmdBldr As OleDbCommandBuilder = New OleDbCommandBuilder(adp)
                        conn.Open()
                        adp.Update(value)
                    Catch ex As Exception
                        'Error during update, add code to locate error, reconcile and try again
                    Finally
                        conn.Close()
                    End Try
                Case 6 'Rates
                    Try
                        adp.SelectCommand = New OleDbCommand("SELECT TTE_NTUSER_ID, TTE_SOCIAL_SECURITY_NBR, TTE_FNAME + ' ' + TTE_LNAME AS NAME, TTE_EMPL_CATEGORY, TTE_CALC_TIMESHEET, TTE_FIVE_PCNT_RATE, TTE_TEN_PCNT_RATE FROM tblTCCTimeCardEmployees WHERE TTE_EMPL_STATUS = 'A' ORDER BY TTE_NTUSER_ID", conn)
                        Dim cmdBldr As OleDbCommandBuilder = New OleDbCommandBuilder(adp)
                        conn.Open()
                        adp.Update(value)
                    Catch ex As Exception
                        'Error during update, add code to locate error, reconcile and try again
                    Finally
                        conn.Close()
                    End Try
            End Select
        End Set
    End Property
  
    Protected Sub cmdAdd_Click(sender As Object, e As System.EventArgs) Handles cmdAdd.Click
        rgDisplay.MasterTableView.InsertItem()
    End Sub
End Class
Chuck Harrington
Top achievements
Rank 1
 answered on 07 Apr 2011
5 answers
180 views
Hi,
I am using Vertical RadSpliter  with 2 RadPane inside. But as I collapse the left pane, the collapse/resize button disappears and I cannot rezise this right pane. The left pane is also partially hidden by the vertical scroll bar.

I really need you help to solve the problem. This is very urgent.

Thanks,
Hai Tran
Hai
Top achievements
Rank 1
 answered on 07 Apr 2011
2 answers
69 views
Hi there,

I'm trying to develop an aspx website to dynamically generate HTML pages made up of predefined elements stored in a database.

Basically the generated pages consist of elements occupying 50% of the width of the page, and elements spanning 100%.
I'd like to create a drag and drop interface allowing users to drag the predefined elements to a 'layout' grid containing two columns. One for the left part of the generated html file, and one for the right part. The dropped elements should then be edited by the user so that he/she can input values like name and id for each dropped element.

Any suggestions which controlls to use and how to use them?
Thanks in advance.

Erik
Erik
Top achievements
Rank 1
 answered on 07 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?