Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
104 views
I have read the documentation on this multiple times and I can't see where I am going wrong.  I have a grid which displays a single column for a list of personnel and another grid which lists events which the user is attending.  My intention was to allow the user to be added to the event simply by dragging the person from the first grid to the second.

Both grids are mapped to ObjectDataSources - although the data sources are different for each.  I get the client side OnRowDropping event fired which I handle client side and ask the user to confirm.  I have checked that this does not change the args.set_cancel however the server side OnRowDrop event is not called.  I have seen this come up before but there is no fix detailed.  

Initially I was using Ajax but I have removed all of that to try a simple postback approach but no change.  Are there additional rules that I must follow to be able to drag from one grid to another where the grids are displaying different information?
Marin
Telerik team
 answered on 14 May 2013
6 answers
186 views
I have a RadGrid in my form that has a MasterViewTable and 1 GridTableView. In my MasterViewTable I will have a total of 1643 records. Out of those parent records, only 160 have child records. Some have 1, Some have a few. There are pages where all the parent records on that page do not have any Children. You will see below my RadGrid declaration all of the functions I am using. The performance is very slow. About 15 to 20 seconds between pagination or sorting. Is there something I am doing wrong or is there something I need to do differently? I have looked at all of the "tuning articles" and believe I am doing everything correctly. I cannot release this grid with that type of delay. One more thing, I am only showing 50 parent rows on every page. Thank you in advance. I call the autoRadGrid.DataBind() function when the user clicks on a drop-down on the screen.

<telerik:RadGrid ID="autoRadGrid" runat="server" Width="1500" Height="700" AllowPaging="true" PagerStyle-Mode="NextPrevAndNumeric" 
  AutoGenerateColumns="false" ShowStatusBar="true" AllowSorting="true" AllowFilteringByColumn="true"
  Skin="WebBlue">
    <MasterTableView PageSize="50" AllowMultiColumnSorting="true" DataKeyNames="DetailID, Day" HierarchyLoadMode="ServerOnDemand" HierarchyDefaultExpanded="true" >
        <DetailTables>
            <telerik:GridTableView Name="SubCodes" Width="100%"
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="DetailID" MasterKeyField="DetailID" />
                    <telerik:GridRelationFields DetailKeyField="Day" MasterKeyField="Day" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridBoundColumn DataField="Sub_Code" HeaderText="Sub Code" UniqueName="Sub_Code" FilterControlWidth="60" HeaderStyle-Width="80"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="HouseHold_Count" HeaderText="Household" UniqueName="HouseHold_Count" FilterControlWidth="60" HeaderStyle-Width="80"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CD1" UniqueName="CD1" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CD2" UniqueName="CD2" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CD3" UniqueName="CD3" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Demographic1" UniqueName="Demographic1" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Demographic2" UniqueName="Demographic2" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Demographic3" UniqueName="Demographic3" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Demographic4" UniqueName="Demographic4" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Demographic5" UniqueName="Demographic5" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn UniqueName="Selected" HeaderText="Selected" SortExpression="Selected" FilterControlWidth="60" HeaderStyle-Width="60">
                        <ItemTemplate>
                            <asp:CheckBox ID="selected" Checked='<%# Bind("Selected") %>' AutoPostBack="false" runat="server" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Forced" HeaderText="Forced" SortExpression="Forced" FilterControlWidth="60" HeaderStyle-Width="60">
                        <ItemTemplate>
                            <asp:CheckBox ID="forced" Checked='<%# Bind("Forced") %>' AutoPostBack="false" runat="server" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Circ" HeaderText="Circ" SortExpression="Circ" FilterControlWidth="60" HeaderStyle-Width="70">
                        <ItemTemplate>
                            <asp:TextBox ID="circ" Text='<%# Bind("Circ") %>' AutoPostBack="false" runat="server" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="Coverage" HeaderText="Coverage" UniqueName="Coverage" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridBoundColumn DataField="Geography" HeaderText="Geography" UniqueName="Geography" FilterControlWidth="60" HeaderStyle-Width="80"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CirculationTypeDescription" HeaderText="Circ Type" UniqueName="CirculationTypeDescription" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="HouseHold_Count" HeaderText="Household" UniqueName="HouseHold_Count" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="TotalCoverage" HeaderText="Total Coverage" UniqueName="TotalCoverage" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LocationMarket" HeaderText="LocationMarket" UniqueName="LocationMarket" FilterControlWidth="60" HeaderStyle-Width="95"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LocationNumber" HeaderText="Location Number" UniqueName="LocationNumber" FilterControlWidth="60" HeaderStyle-Width="75"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LocationName" HeaderText="Location Name" UniqueName="LocationName" FilterControlWidth="60" HeaderStyle-Width="110"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Distance" HeaderText="Distance" UniqueName="Distance" FilterControlWidth="60" HeaderStyle-Width="75"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Sales" HeaderText="Sales" UniqueName="Sales" FilterControlWidth="60" HeaderStyle-Width="50"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="TotalSales" HeaderText="Total Sales" UniqueName="TotalSales" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="BOS" HeaderText="BOS" UniqueName="BOS" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CumeBOS" HeaderText="Cume BOS" UniqueName="CumeBOS" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SPH" HeaderText="SPH" UniqueName="SPH" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SPHIndex" HeaderText="SPH Index" UniqueName="SPHIndex" FilterControlWidth="60" HeaderStyle-Width="80"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CD1" UniqueName="CD1" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CD2" UniqueName="CD2" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CD3" UniqueName="CD3" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Demographic1" UniqueName="Demographic1" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Demographic2" UniqueName="Demographic2" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Demographic3" UniqueName="Demographic3" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Demographic4" UniqueName="Demographic4" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Demographic5" UniqueName="Demographic5" FilterControlWidth="60" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Day" HeaderText="Day" UniqueName="Day" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="Selected" HeaderText="Selected" SortExpression="Selected" FilterControlWidth="60" HeaderStyle-Width="60">
                <ItemTemplate>
                    <asp:CheckBox ID="selected" Checked='<%# Bind("Selected") %>' AutoPostBack="false" runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="Forced" HeaderText="Forced" SortExpression="Forced" FilterControlWidth="60" HeaderStyle-Width="60">
                <ItemTemplate>
                    <asp:CheckBox ID="forced" Checked='<%# Bind("Forced") %>' AutoPostBack="false" runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="Circ" HeaderText="Circ" SortExpression="Circ" FilterControlWidth="60" HeaderStyle-Width="70">
                <ItemTemplate>
                    <asp:TextBox ID="circ" Text='<%# Bind("Circ") %>' AutoPostBack="false" runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="Coverage" HeaderText="Coverage" UniqueName="Coverage" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Zones" HeaderText="Zones" UniqueName="Zones" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Version" HeaderText="Version" UniqueName="Version" FilterControlWidth="60" HeaderStyle-Width="90"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SubVersionCategory" HeaderText="Sub-Version Category" UniqueName="SubVersionCategory" FilterControlWidth="90" HeaderStyle-Width="70"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="DeliveryCode" HeaderText="Delivery Code" UniqueName="DeliveryCode" FilterControlWidth="90" HeaderStyle-Width="70"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
      
    <ClientSettings AllowColumnsReorder="true" ColumnsReorderMethod="Swap" >
        <ClientEvents OnGridCreated="GetGridObject" />
        <Scrolling AllowScroll="true" FrozenColumnsCount="2" UseStaticHeaders="true" SaveScrollPosition="true" />
        <Selecting AllowRowSelect="true" />
        <Resizing AllowColumnResize="true" />
    </ClientSettings>
</telerik:RadGrid>

NeedDataSource
Private Sub autoRadGrid_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles autoRadGrid.NeedDataSource
    If mintCircSetID > 0 Then
        Dim intIndex As Integer = 0
        Dim strSortedColumn As String = ""
        Dim strSortClause As String = ""
        mstrSQL = ""
        mstrSQL = "EXEC WB_sp_RetrieveGeographySelection_ForTelerik '" & mstrSessionID & "'," & mintEventID
        If mblnFullRunUtilizedInd Or cbSingleZip.Checked Then
            mstrSQL = mstrSQL & ",0"
        Else
            mstrSQL = mstrSQL & ",1"
        End If
        If cbSundayFR.Checked Or cbSundayHD.Checked Or cbSundaySC.Checked Or cbSundayMX.Checked Then
            mstrSQL = mstrSQL & ",1"
        Else
            mstrSQL = mstrSQL & ",0"
        End If
        If cbMondayFR.Checked Or cbMondayHD.Checked Or cbMondaySC.Checked Or cbMondayMX.Checked Then
            mstrSQL = mstrSQL & ",1"
        Else
            mstrSQL = mstrSQL & ",0"
        End If
        If cbTuesdayFR.Checked Or cbTuesdayHD.Checked Or cbTuesdaySC.Checked Or cbTuesdayMX.Checked Then
            mstrSQL = mstrSQL & ",1"
        Else
            mstrSQL = mstrSQL & ",0"
        End If
        If cbWednesdayFR.Checked Or cbWednesdayHD.Checked Or cbWednesdaySC.Checked Or cbWednesdayMX.Checked Then
            mstrSQL = mstrSQL & ",1"
        Else
            mstrSQL = mstrSQL & ",0"
        End If
        If cbThursdayFR.Checked Or cbThursdayHD.Checked Or cbThursdaySC.Checked Or cbThursdayMX.Checked Then
            mstrSQL = mstrSQL & ",1"
        Else
            mstrSQL = mstrSQL & ",0"
        End If
        If cbFridayFR.Checked Or cbFridayHD.Checked Or cbFridaySC.Checked Or cbFridayMX.Checked Then
            mstrSQL = mstrSQL & ",1"
        Else
            mstrSQL = mstrSQL & ",0"
        End If
        If cbSaturdayFR.Checked Or cbSaturdayHD.Checked Or cbSaturdaySC.Checked Or cbSaturdayMX.Checked Then
            mstrSQL = mstrSQL & ",1"
        Else
            mstrSQL = mstrSQL & ",0"
        End If
        mstrSQL = mstrSQL & "," & mintParentMap
        If cbSundayFR.Checked Or cbMondayFR.Checked Or cbTuesdayFR.Checked Or cbWednesdayFR.Checked Or cbThursdayFR.Checked Or cbFridayFR.Checked Or cbSaturdayFR.Checked Then
            mstrSQL = mstrSQL & ",1,1,1"
        Else
            If cbSundayHD.Checked Or cbMondayHD.Checked Or cbTuesdayHD.Checked Or cbWednesdayHD.Checked Or cbThursdayHD.Checked Or cbFridayHD.Checked Or cbSaturdayHD.Checked Then
                mstrSQL = mstrSQL & ",1"
            Else
                mstrSQL = mstrSQL & ",0"
            End If
            If cbSundayMX.Checked Or cbMondayMX.Checked Or cbTuesdayMX.Checked Or cbWednesdayMX.Checked Or cbThursdayMX.Checked Or cbFridayMX.Checked Or cbSaturdayMX.Checked Then
                mstrSQL = mstrSQL & ",1"
            Else
                mstrSQL = mstrSQL & ",0"
            End If
            If cbSundaySC.Checked Or cbMondaySC.Checked Or cbTuesdaySC.Checked Or cbWednesdaySC.Checked Or cbThursdaySC.Checked Or cbFridaySC.Checked Or cbSaturdaySC.Checked Then
                mstrSQL = mstrSQL & ",1"
            Else
                mstrSQL = mstrSQL & ",0"
            End If
        End If
        intIndex = UBound(Split(hidSortInformation.Value, ","))
        Do While intIndex >= 0
            strSortedColumn = Trim(Split(hidSortInformation.Value, ",")(intIndex))
            strSortClause = strSortClause & strSortedColumn & ","
            intIndex -= 1
        Loop
        strSortClause = Left(strSortClause, Len(strSortClause) - 1)
        mstrSQL = mstrSQL & ",'" & strSortClause & "',"
        If cbSortingByParent.Checked Then
            mstrSQL = mstrSQL & "1"
        Else
            mstrSQL = mstrSQL & "0"
        End If
        mstrSQL = mstrSQL & ",''"
        If Not e.IsFromDetailTable Then
            autoRadGrid.DataSource = GetDataTable(mstrSQL & ",0,0,''")
        End If
    End If
End Sub

ItemDataBound
Private Sub autoRadGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles autoRadGrid.ItemDataBound
    If (TypeOf (e.Item) Is GridDataItem) And e.Item.OwnerTableView.Name <> "SubCodes" Then
        Dim dataBoundItem As GridDataItem = e.Item
        Dim dataRow As DataRowView = dataBoundItem.DataItem
        Dim index As Integer = dataBoundItem.ItemIndex
        dataBoundItem("Geography").Text = dataBoundItem("Geography").Text.Trim
        dataBoundItem("Zones").Text = dataBoundItem("Zones").Text.Trim
        If dataBoundItem("TotalCoverage").Text > 0 And UCase(Request("TargetGeo")) <> "TRUE" Then
            dataBoundItem("TotalCoverage").Attributes.Add("onClick", "Javascript:fnOpenGeoInfoView('" & dataBoundItem("Geography").Text.ToString.Trim & "'," & mintEventID & "," & ddlCircSet.SelectedItem.Value & ")")
            dataBoundItem("TotalCoverage").CssClass = "GridLink"
        End If
        Dim strSubCode As String = ""
        Dim mode As Integer = 0
        Dim day As Integer = 0
        Dim circType As Integer = 0
        If dataBoundItem("Zones").Text.Trim = "" Or dataBoundItem("Zones").Text.Trim = " " Then
            mode = 0
        ElseIf InStr(dataBoundItem("Zones").Text.Trim, "NPP") > 0 Or InStr(dataBoundItem("Zones").Text.Trim, "NOPP") > 0 Then
            mode = 1
        Else
            mode = 2
        End If
        If dataBoundItem("Day").Text.Trim.ToUpper = "SUNDAY" Then
            day = 1
        ElseIf dataBoundItem("Day").Text.Trim.ToUpper = "MONDAY" Then
            day = 2
        ElseIf dataBoundItem("Day").Text.Trim.ToUpper = "TUESDAY" Then
            day = 3
        ElseIf dataBoundItem("Day").Text.Trim.ToUpper = "WEDNESDAY" Then
            day = 4
        ElseIf dataBoundItem("Day").Text.Trim.ToUpper = "THURSDAY" Then
            day = 5
        ElseIf dataBoundItem("Day").Text.Trim.ToUpper = "FRIDAY" Then
            day = 6
        ElseIf dataBoundItem("Day").Text.Trim.ToUpper = "SATURDAY" Then
            day = 7
        End If
        If dataBoundItem("CirculationTypeDescription").Text.Trim.ToUpper = "HOME DELIVERED" Then
            circType = 1
        ElseIf dataBoundItem("CirculationTypeDescription").Text.Trim.ToUpper = "SINGLE COPY" Then
            circType = 3
        ElseIf dataBoundItem("CirculationTypeDescription").Text.Trim.ToUpper = "MIXED" Then
            circType = 2
        End If
        dataBoundItem("Selected").Attributes.Add("onClick", "javascript:return fnSelectDayForTelerik(" & index & "," & mode & "," & mintEventID & "," & circType & "," & day & "," & ddlCircSet.SelectedItem.Value & ",'" & mstrSessionID & "'," & Request("PARID") & ",'" & Trim(UCase(Request("TargetGeo"))) & "',0);")
        dataBoundItem("Forced").Attributes.Add("onClick", "javascript:return fnSelectDayForTelerik(" & index & "," & mode & "," & mintEventID & "," & circType & "," & day & "," & ddlCircSet.SelectedItem.Value & ",'" & mstrSessionID & "'," & Request("PARID") & ",'" & Trim(UCase(Request("TargetGeo"))) & "',1);")
        Dim textBox1 As TextBox
        textBox1 = dataBoundItem("Circ").FindControl("Circ")
        textBox1.Attributes.Add("onChange", "javascript:ValidateCirculationForTelerik(" & index & "," & mintEventID & "," & circType & "," & day & "," & ddlCircSet.SelectedItem.Value & ",'" & mstrSessionID & "'," & Request("PARID") & ",''," & textBox1.Text & ",this);")
        Dim strZones As String = "No"
        If mblnFullRunUtilizedInd Or cbSingleZip.Checked Then
            strZones = "No"
        Else
            If dataBoundItem("Zones").Text.Trim = "" Or dataBoundItem("Zones").Text.Trim = " " Then
                strZones = "No"
            ElseIf InStr(dataBoundItem("Zones").Text.Trim, "NPP") > 0 Or InStr(dataBoundItem("Zones").Text.Trim, "NOPP") > 0 Then
                strZones = "No"
            Else
                strZones = "Yes"
            End If
        End If
        If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
            If miVersionsCategoryID > 0 Then
                dataBoundItem("Version").Attributes.Add("onClick", "javascript:fnVersionOverrideForTelerik(" & index & ",'" & strZones & "'," & mintEventID & "," & circType & "," & day & ");")
                dataBoundItem("Version").CssClass = "GridLink"
            End If
        End If
        If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
            If miDeliveryCodeCount > 0 And ddlDeliveryCodeCategory.SelectedIndex > 0 Then
                dataBoundItem("DeliveryCode").Attributes.Add("onClick", "javascript:fnDeliveryCodeOverrideForTelerik(" & index & ",'" & strZones & "'," & mintEventID & "," & circType & "," & day & "," & ddlDeliveryCodeCategory.SelectedValue & ");")
                dataBoundItem("DeliveryCode").CssClass = "GridLink"
            Else
                dataBoundItem("DeliveryCode").Text = ""
            End If
        End If
    End If
End Sub

ItemCreated
Private Sub autoRadGrid_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles autoRadGrid.ItemCreated
    If (TypeOf (e.Item) Is GridNoRecordsItem) Then
        e.Item.OwnerTableView.Visible = False
    End If
End Sub

PreRenderer
Private Sub autoRadGrid_PreRender(sender As Object, e As System.EventArgs) Handles autoRadGrid.PreRender
    HideExpandColumnRecursive(autoRadGrid.MasterTableView)
End Sub

DetailTableDataBind
Private Sub autoRadGrid_DetailTableDataBind(sender As Object, e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles autoRadGrid.DetailTableDataBind
     Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
     Select Case e.DetailTableView.Name
         Case "SubCodes"
             Dim detailID As Integer = dataItem.GetDataKeyValue("DetailID").ToString()  
             Dim Day As String = dataItem.GetDataKeyValue("Day").ToString()
             If mintCircSetID > 0 Then 
                 e.DetailTableView.DataSource = GetDataTable(mstrSQL & ",1," & detailID & ",'" & Day & "'")
             End If
     End Select
 End

HideExpandColumnRecursive
Public Sub HideExpandColumnRecursive(ByVal tableView As GridTableView)
    Dim nestedViewItems As GridItem() = tableView.GetItems(GridItemType.NestedView)
    For Each nestedViewItem As GridNestedViewItem In nestedViewItems
        For Each nestedView As GridTableView In nestedViewItem.NestedTableViews
            If nestedView.Items.Count = 0 Then
                Dim cell As TableCell = nestedView.ParentItem("ExpandColumn")
                cell.Controls(0).Visible = False
                nestedViewItem.Visible = False
            End If
            If nestedView.HasDetailTables Then
                HideExpandColumnRecursive(nestedView)
            End If
        Next
    Next
End Sub

GetDataTable
Public Function GetDataTable(ByVal query As String) As DataTable
    Dim ConnString As String = ConfigurationManager.ConnectionStrings("iAnalyzeConnectionString").ConnectionString
    Dim conn As SqlConnection = New SqlConnection(ConnString)
    Dim adapter As SqlDataAdapter = New SqlDataAdapter
    adapter.SelectCommand = New SqlCommand(query, conn)
    Dim table1 As New DataTable
    conn.Open()
    Try
        adapter.Fill(table1)
    Finally
        conn.Close()
    End Try
    Return table1
End Function

Vasil
Telerik team
 answered on 14 May 2013
1 answer
38 views
I am evaluating the orgchart right now.

I am trying to show 6 levels deep but collapse anything below the 3rd level initially.  When the user clicks on the + button to expand the node, it should expand.  The user can continue to do this until they get to the 6th level.  Then when the user wants to expand further than the 6th level, then I will need to do a client side on demand load to get more data (hopefully without repainting the whole orgchart).

So, for the 1st part, I would like to preload the orgchart up to 6 levels deep but collapse anything lower than the 3rd level.  I can't find much documentation on how to use the RAgOrgChart.collapseNodes method and the OrgChartExpandCollapseNodeCriteria . We are using simple binding.

Any help would be greatly appreciated.  Thanks. 
Peter Filipov
Telerik team
 answered on 14 May 2013
2 answers
347 views
 <telerik:GridTemplateColumn UniqueName="BankType" AllowFiltering="false" EditFormHeaderTextFormat=" ">
                    <EditItemTemplate>
                        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Fieldset"
                            Skin="Outlook" />
                        <div style="height: 150px; width: 142px; float: left; margin-left: -20px; margin-bottom: 20px;
                            border: rgb(102,102,102) solid 1px; border-radius: 8px; padding: 0px 0px 0px 5px;
                            font-family: Bold; font-size: 12px; position: relative; bottom: 100px; top: 10px;
                            left: 20px;">
                            <span style="font-weight: normal; font-family: Verdana; background-color: rgb(215,230,255);
                                font-weight: normal; margin-top: 4px; left: 10px; position: relative; top: -10px;">
                                &nbsp;Bank Type</span>
                            <telerik:RadGrid ID="RgList1" runat="server" AutoGenerateColumns="false" ShowHeader="false"  CssClass="RgListPosition1" >
                                <MasterTableView AutoGenerateColumns="false">
                                    <Columns>
                                        <telerik:GridTemplateColumn HeaderText="BankTypeName">
                                            <ItemTemplate>
                                                <%# Eval("BankTypeName")%>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="chkBankList1" HeaderText="Select">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkBankTypeName" runat="server" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                </MasterTableView>
                                <ClientSettings EnableRowHoverStyle="false"></ClientSettings>
                            </telerik:RadGrid>
                        </div>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

The Above code ..is inside another grid ....when user select the inner grid checked box ,I  want to set some " css class color" to the row .
Sairam
Top achievements
Rank 1
 answered on 14 May 2013
1 answer
258 views
Hi there

Exporting a grid to the client side is pretty straight forward, but I can't seem to find a way to save it directly to a folder on the server?

I have found a post: 
http://www.telerik.com/community/forums/aspnet-ajax/grid/save-directly-to-file-by-export-to-excel-feature-of-radgrid.aspx

Its more than 2 years old, so I was just wondering if there is a better way of doing this?

Thank you.
Daniel
Telerik team
 answered on 14 May 2013
2 answers
143 views
hello,

there is an issue with fixed height of the raddock when its inside of an iframe.
the thing is that the raddock and the rdcontent gets the same height which causes the raddocks to overlap each other.
i have tested it with explorer 10 and firefox and it happens with both of them with chrome its working fine.

this is the main page:
<head runat="server">
    <title></title>
</head>
<body style="height:100%; width:100%;">
    <form id="Form1" method="post" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
        <div id="divRadTabStrip" runat="server">
            <div dir="ltr" >
            <!-- SET SKIN: Lnet_innerReports -->
                <telerik:RadTabStrip Skin="Sitefinity" ID="tbsFeedbaks" Runat="server" MultiPageID="mltpFeedbacks" SelectedIndex="0">
                    <Tabs>
                        <telerik:RadTab PageViewID="pvFirstTab" Text="tab1"></telerik:RadTab>
                        <telerik:RadTab PageViewID="pvSecondTab" Text="tab2"></telerik:RadTab>
                        <telerik:RadTab PageViewID="pvThirdTab" Text="tab3"></telerik:RadTab>                      
                    </Tabs>
                </telerik:RadTabStrip>
            </div>
        </div>     
        <telerik:RadMultiPage ID="mltpFeedbacks" Runat="server" SelectedIndex="0" width="100%">
            <telerik:RadPageView ID="pvFirstTab" runat="server">
                <iframe frameborder="0" id="frmFeedbackByQuestion" name="frmFeedbackByQuestion" runat="server" src="feedBacksItemByQues.aspx" width="955px" height="500px" allowTransparency="true"></iframe>
            </telerik:RadPageView>
            <telerik:RadPageView ID="pvSecondTab" runat="server">
                <iframe id="frmFeedbackBySubjects" name="frmFeedbackBySubjects" runat="server" frameborder="0" src="feedBackExercistBySubjAndStud.aspx" width="955px" height="500px" allowTransparency="true"></iframe>
            </telerik:RadPageView>
            <telerik:RadPageView ID="pvThirdTab" runat="server">
                <iframe id="frmFeedbackGrades" name="frmFeedbackGrades" runat="server" frameborder="0" src="feedbackActivitiesGradesByItemInGroup.aspx" width="955px" height="500px"  allowTransparency="true"></iframe>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
    </form>
</body>
</html>
all the tabs has the same HTML:
<head runat="server">
    <title></title>
    <style type="text/css">
        .topSpacer {margin-top:10px;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
        <telerik:RadDockZone ID="RadDockZone1" runat="server" Orientation="Vertical" BorderWidth="0">
            <telerik:RadDock ID="dockChart" EnableRoundedCorners="true" runat="server" DockMode="Docked" EnableDrag="false" Width="910px" Height="200px" Text="Assignments" >
                <ContentTemplate>
                 <div>
                    text text text text text text text text text text text text text text text
                    text text text text text text text text text text text text text text text
                    text text text text text text text text text text text text text text text
                 </div>
                </ContentTemplate>
            </telerik:RadDock>
            <telerik:RadDock ID="dockSumTable" EnableRoundedCorners="true" runat="server" DockMode="Docked" EnableDrag="false" Width="910px" Height="180px" CssClass="topSpacer">                   
                    <ContentTemplate>
                        <div style="width: 100%; background-color: #ffffff;" >
                            <table>
                                <tbody>
                                    <tr>
                                        <td>111111111111111</td>
                                        <td>222222222222222</td>
                                        <td>333333333333333</td>
                                    </tr>
                                    <tr>
                                        <td>444444444444444</td>
                                        <td>555555555555555</td>
                                        <td>666666666666666</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </ContentTemplate>
                </telerik:RadDock>
        </telerik:RadDockZone>
    </telerik:RadDockLayout>
    </form>
</body>
</html>

you can see in the pictures that the height is not calculated properly on tab2 and tab3
ido nahmias
Top achievements
Rank 1
 answered on 14 May 2013
6 answers
521 views
I am having an issue with a RadGrid that populates it's datasource through the NeedDataSource method/event and allows users to due clients-die batch edits then updates using this sample as a base: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx.

When the data from more than one row in the RadGrid is modified then the batch update image/command is issued, only one row is updated and the changes in other rows are not being refreshed/reflected in the grid like it's remembering the old values and someone not processing more than one row.  I am not sure if it's related to the grid's datasource being set through the code-behind and the grid.

I tried to only include the code that could potentially cause issues, like the Page Load, NeedSource, Update, Client Events, and RadGrid definition.  I have also changed some field values for posting here in case there are any minor typos.
Antonio Stoilkov
Telerik team
 answered on 14 May 2013
1 answer
60 views
I noticed that each update contains folders like scripts, skins, but none of these folders show up in our project files.  We can see the references in the project files to the Telerik assemblies but not much else.  I am worried that our continuous build process is not accessing the correct resources.  Can someone give me some idea of how Telerik integrates into builds?  We need to know how to source control Telerik's files so that branched versions of our code base find the appropriate telerik version with all supporting files.
Martin
Telerik team
 answered on 14 May 2013
1 answer
79 views

I am trying to figure out a way to change the culture attribute of items being loaded thru the RadInputManager.

I'm using the methods I've found on the site to build the RadInputManager when a page is loaded.

I use the Page_Init to add settings:

protected void Page_Init(object sender, EventArgs e)
{
    NumericTextBoxSetting numericSetting = new NumericTextBoxSetting();
    numericSetting.Validation.IsRequired = false;
    numericSetting.BehaviorID = "numeric";
    numericSetting.InitializeOnClient = true;
    RadInputManager1.InputSettings.Add(numericSetting);
 
    NumericTextBoxSetting _currencySetting = new NumericTextBoxSetting();
    _currencySetting.BehaviorID = "currency";
    _currencySetting.DecimalDigits = 2;
    _currencySetting.Type = NumericType.Currency;
    _currencySetting.Validation.IsRequired = false;
    _currencySetting.InitializeOnClient = true;
    RadInputManager1.InputSettings.Add(_currencySetting);
 
}

And apply it like:

TextBox _txtTotal = (TextBox)e.Item.FindControl("txtTotal");
RadInputManager1.InputSettings[1].TargetControls.Add(new TargetInput(_txtTotal.UniqueID, true));

This works like a charm.  I want to change the culture of the rendered controls based on selections that the user places on the screen.  I can't do it on the Page_Init, however, because the data is not available at the time.

Is there a way to change the culture after I've used the Page_Init to build the controls?
Vasil
Telerik team
 answered on 14 May 2013
2 answers
383 views
I am getting this error after I reset the values of the controls including RadComboBox.
Here's the scenario:

1. I have asp.net controls including dropdownlist, textbox and 2 RadComboBox
2. First RadComboBox = source depends on asp.net dropdownlist selected value
3. Second RadComboBox = source depends on First RadComboBox selected value
4. ASP.NET dropdownlist and First RadComboBox are set to autopostback=true and have selectedindexchanged events
5. Has an asp.net button "Reset" to reset/clear the values for the controls

Error occurs when I select an item on ASP.NET dropdownlist after OnClick event of reset button
Below is the error I got on our log file since when in debug mode, I just get a blank page

[09/05/2013 13:27:30][ERROR]:
    Message: Object reference not set to an instance of an object.
    Source: Telerik.Web.UI
    StackTrace:    at Telerik.Web.UI.RadComboBox.OnInit(EventArgs e)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.AddedControl(Control control, Int32 index)
   at System.Web.UI.ControlCollection.Add(Control child)
   at Telerik.Web.UI.GridPagerItem.InitializePagerItem(GridColumn[] columns)
   at Telerik.Web.UI.GridPagerItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)
   at Telerik.Web.UI.GridTableView.CreateTopPagerItem(Boolean useDataSource, GridColumn[] copiedColumnSet, Boolean isPagingEnabled, GridTHead thead)
   at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
   at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
   at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
   at System.Web.UI.Control.EnsureChildControls()
   at Telerik.Web.UI.GridTableViewBase.get_Controls()
   at Telerik.Web.UI.GridTableView.GetGridTable()
   at Telerik.Web.UI.RadGrid.PrepareRowsVisibility(GridTableView view)
   at Telerik.Web.UI.RadGrid.PrepareItems()
   at Telerik.Web.UI.RadGrid.ControlPreRender()
   at Telerik.Web.UI.RadCompositeDataBoundControl.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Notes:
  • I already remove the partial postback (radajaxmanager)
  • I retain the event for asp.net dropdownlist and radcombobox event but commented all codes inside it so it will just postback and no code will be executed

OnClick event has below code: (I also tried commenting the part of the 2 RadComboBox which are: ddlFailureCategory and ddlFailureSubCategory but still get error)

txtCaseNo.Text = string.Empty;
this.IsFirstLoad = true;
 
chkICAR.SelectedValue = "No";
chk8D.SelectedValue = "No";
chkReassignAccept.SelectedValue = "No";
chkReassignReject.SelectedValue = "No";
chkRevertActionItem.SelectedValue = "No";
chkReopenCase.SelectedValue = "No";
chkAutoRaise.SelectedValue = "No";
chkActivateCase.SelectedValue = "No";
 
ddlStatus.SelectedIndex = -1;
ddlModule.SelectedIndex = -1;
ddlFailureCategory.SelectedIndex = -1;
ddlFailureSubCategory.SelectedIndex = -1;
ddlCaseType.SelectedIndex = -1;
ddlTechnology.SelectedIndex = -1;
ddlOwnershipGroup.SelectedIndex = -1;
 
ddlCondCaseNo.SelectedIndex = -1;
ddlCondStatus.SelectedIndex = -1;
ddlCondModule.SelectedIndex = -1;
ddlCondFailureCategory.SelectedIndex = -1;
ddlCondFailureSubCategory.SelectedIndex = -1;
ddlCondCaseType.SelectedIndex = -1;
ddlCondTech.SelectedIndex = -1;
ddlCondOwnershipGroup.SelectedIndex = -1;
ddlCondCaseICAR.SelectedIndex = -1;
ddlCondCase8D.SelectedIndex = -1;
ddlCondReassignAccept.SelectedIndex = -1;
ddlCondReassignReject.SelectedIndex = -1;
ddlCondRevertActionItem.SelectedIndex = -1;
ddlCondReopenCase.SelectedIndex = -1;
ddlCondAutoRaise.SelectedIndex = -1;
ddlCondActivateCase.SelectedIndex = -1;
 
txtCaseNo.Enabled = false;
ddlStatus.Enabled = false;
ddlModule.Enabled = false;
ddlFailureCategory.Enabled = false;
ddlFailureSubCategory.Enabled = false;
ddlCaseType.Enabled = false;
ddlTechnology.Enabled = false;
ddlOwnershipGroup.Enabled = false;
 
chkICAR.Enabled = false;
chk8D.Enabled = false;
chkReassignAccept.Enabled = false;
chkReassignReject.Enabled = false;
chkRevertActionItem.Enabled = false;
chkReopenCase.Enabled = false;
chkAutoRaise.Enabled = false;
chkActivateCase.Enabled = false;

Kindly give an advice on how to interpret the error I got since in debug mode, I didn't get an exception.

Thanks.
Jayzle
Top achievements
Rank 1
 answered on 14 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?