Issue with Radgrid inside a panelbar

2 posts, 0 answers
  1. bhaskar
    bhaskar avatar
    3 posts
    Member since:
    Jun 2007

    Posted 17 Nov 2011 Link to this post

    Dear Telerik Team,

    I am trying to add a grid dynamically within a panelbar.The panel bar is created at design time.
    I am getting the below issue  :

    Radpanelbar is contained inside a div and grid is inside the panelbar. When the Panelbar item is clicked, then grid is generated and populated by the dataset.The problem is that the header of the grid is scrollable alongwith the panelbar but the grid rows do not get scrolled and remain static.

    Please suggest a resolution it is very urgent.There seem to be lot of issues with Radgrid when it is used inside a panelbar by generating dynamically.

    Here is the code  :

    ASPX:

     

     

     

    <div id="divChangeImpact" style="width:100%;height:100;overflow:auto">

     

     

     

    <rad:RadAjaxPanel ID="ajPanelImpact" runat="server" ScrollBars="None" Width="100%" Height="100" LoadingPanelID="AjaxLoadingPanelAccount">

     

     

     

     

     

     

     

     

    <rad:RadPanelbar ID="panelChangeImpact" runat="server" Width="100%"

     

     

     

    Height="100px" ExpandMode="SingleExpandedItem" Skin="Outlook">

     

     

     

     

     

     

     

     

     

    </rad:RadPanelbar>

     

     

     

     

     

     

     

     

    </rad:RadAjaxPanel>

     

     

     

     

     

     

     

     

    </div>

    CodeBehind (VB) :

    Adding items to panel:

     

    Private

     

     

    Sub BindTerritory()

     

     

     

    '--Items added to PanelBar----------------------------------------------------------

     

     

     

     

    For Each row As DataRow In dsDirs.Tables(0).Rows

     

     

     

    Dim dataItem As New RadPanelItem()

     

    dataItem.Text =

     

    Convert.ToString(row("Sales_position_name"))

     

    dataItem.Value =

     

    Convert.ToString(row("Sales_pos_id"))

     

    dataItem.Expanded =

     

    False

     

     

     

     

     

    panelChangeImpact.Items.Add(dataItem)

     

     

    Dim item As New RadPanelItem()

     

    dataItem.Items.Add(item)

     

     

    Next

     

     

     

     

    ClsGeneral.setDropDownTitle(ddlTerritory)

     

     

     

    End Sub

     

    Protected

     

     

    Sub panelChangeImpact_ItemClick(ByVal sender As Object, ByVal e As Telerik.WebControls.RadPanelbarEventArgs) Handles panelChangeImpact.ItemClick

     

     

     

    Dim ItemClicked As Telerik.WebControls.RadPanelItem = e.Item

     

     

     

    Dim str As String = ItemClicked.Text

     

     

     

    Dim radGridImpact As New RadGrid

     

     

     

     

     

    radGridImpact.ID =

     

    "rgvChangeImpact"

     

     

     

     

     

    radGridImpact.Width =

     

    Unit.Percentage(100)

     

    radGridImpact.AllowMultiRowSelection =

     

    True

     

     

     

     

     

    radGridImpact.AutoGenerateColumns =

     

    False

     

     

     

     

     

    radGridImpact.Skin =

     

    "Master"

     

     

     

     

     

    radGridImpact.IsDynamic =

     

    False

     

     

     

     

     

    radGridImpact.SkinsPath =

     

    "~/App_Themes/MasterTheme/Skins"

     

     

     

     

     

    radGridImpact.MasterTableView.TableLayout =

     

    GridTableLayout.Fixed

     

    radGridImpact.MasterTableView.Width =

     

    Unit.Percentage(100)

     

    radGridImpact.MasterTableView.NoMasterRecordsText =

     

    ""

     

     

     

     

     

    radGridImpact.ItemStyle.BorderStyle =

     

    BorderStyle.Solid

     

    radGridImpact.ItemStyle.BorderWidth =

     

    Unit.Pixel(1)

     

    radGridImpact.ItemStyle.BorderColor = Drawing.

     

    Color.Black

     

    radGridImpact.ClientSettings.EnablePostBackOnRowClick =

     

    False

     

     

     

     

     

    radGridImpact.ClientSettings.Selecting.AllowRowSelect =

     

    True

     

     

     

     

     

    radGridImpact.ClientSettings.Scrolling.AllowScroll =

     

    True

     

     

     

     

     

    radGridImpact.ClientSettings.Scrolling.ScrollHeight =

     

    Unit.Pixel(140)

     

    radGridImpact.ClientSettings.Scrolling.UseStaticHeaders =

     

    True

     

     

     

     

     

    radGridImpact.ClientSettings.Scrolling.SaveScrollPosition =

     

    True

     

     

     

     

     

     

     

    Dim column1 As New GridBoundColumn

     

     

     

     

     

    column1.SortAscImageUrl =

     

    "#"

     

     

     

     

     

    column1.DataField =

     

    "Rule_Violation"

     

     

     

     

     

    column1.FilterImageUrl =

     

    "#"

     

     

     

     

     

    column1.UniqueName =

     

    "Rule_Violation"

     

     

     

     

     

    column1.SortExpression =

     

    "Rule_Violation"

     

     

     

     

     

    column1.SortDescImageUrl =

     

    "#"

     

     

     

     

     

    column1.HeaderText =

     

    "Rule Violation"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column1)

     

     

    Dim column2 As New GridBoundColumn

     

     

     

     

     

    column2.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column2.DataField =

     

    "Matric"

     

     

     

     

     

    column2.HeaderText =

     

    "<nobr>Metric Rule</nobr>"

     

     

     

     

     

    column2.SortExpression =

     

    "Matric"

     

     

     

     

     

    column2.UniqueName =

     

    "Matric"

     

     

     

     

     

    column2.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column2.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column2)

     

     

    Dim column3 As New GridBoundColumn

     

     

     

     

     

    column3.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column3.DataField =

     

    "Original"

     

     

     

     

     

    column3.HeaderText =

     

    "<nobr>Original</nobr>"

     

     

     

     

     

    column3.SortExpression =

     

    "Original"

     

     

     

     

     

    column3.UniqueName =

     

    "Original"

     

     

     

     

     

    column3.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column3.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column3)

     

     

    Dim column4 As New GridBoundColumn

     

     

     

     

     

    column4.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column4.DataField =

     

    "Adjusted_Approved"

     

     

     

     

     

    column4.HeaderText =

     

    "<nobr>Approved</nobr>"

     

     

     

     

     

    column4.SortExpression =

     

    "Adjusted_Approved"

     

     

     

     

     

    column4.UniqueName =

     

    "Adjusted_Approved"

     

     

     

     

     

    column4.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column4.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column4)

     

     

    Dim column5 As New GridBoundColumn

     

     

     

     

     

    column5.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column5.DataField =

     

    "Adjusted_Pending"

     

     

     

     

     

    column5.HeaderText =

     

    "<nobr>Approval Pending</nobr>"

     

     

     

     

     

    column5.SortExpression =

     

    "Adjusted_Pending"

     

     

     

     

     

    column5.UniqueName =

     

    "Adjusted_Pending"

     

     

     

     

     

    column5.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column5.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column5)

     

     

    Dim column6 As New GridBoundColumn

     

     

     

     

     

    column6.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column6.DataField =

     

    "Adjusted_Submission"

     

     

     

     

     

    column6.HeaderText =

     

    "<nobr>Submission Pending</nobr>"

     

     

     

     

     

    column6.SortExpression =

     

    "Adjusted_Submission"

     

     

     

     

     

    column6.UniqueName =

     

    "Adjusted_Submission"

     

     

     

     

     

    column6.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column6.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column6)

     

     

    Dim column7 As New GridBoundColumn

     

     

     

     

     

    column7.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column7.DataField =

     

    "Total_Adjusted"

     

     

     

     

     

    column7.HeaderText =

     

    "<nobr>Change Impact</nobr>"

     

     

     

     

     

    column7.SortExpression =

     

    "Total_Adjusted"

     

     

     

     

     

    column7.UniqueName =

     

    "Total_Adjusted"

     

     

     

     

     

    column7.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column7.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column7)

     

     

    Dim column8 As New GridBoundColumn

     

     

     

     

     

    column8.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column8.DataField =

     

    "GTotal"

     

     

     

     

     

    column8.HeaderText =

     

    "<nobr>Total</nobr>"

     

     

     

     

     

    column8.SortExpression =

     

    "GTotal"

     

     

     

     

     

    column8.UniqueName =

     

    "GTotal"

     

     

     

     

     

    column8.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column8.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column8)

     

     

    Dim column9 As New GridBoundColumn

     

     

     

     

     

    column9.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column9.DataField =

     

    "Change"

     

     

     

     

     

    column9.HeaderText =

     

    "<nobr>Total Change</nobr>"

     

     

     

     

     

    column9.SortExpression =

     

    "Change"

     

     

     

     

     

    column9.UniqueName =

     

    "Change"

     

     

     

     

     

    column9.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column9.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column9)

     

     

    Dim column10 As New GridBoundColumn

     

     

     

     

     

    column10.DataFormatString =

     

    "<nobr>{0}</nobr>"

     

     

     

     

     

    column10.DataField =

     

    "Allowed"

     

     

     

     

     

    column10.HeaderText =

     

    "<nobr>Allowed(Min, Max)</nobr>"

     

     

     

     

     

    column10.SortExpression =

     

    "Allowed"

     

     

     

     

     

    column10.UniqueName =

     

    "Allowed"

     

     

     

     

     

    column10.SortAscImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Asc.gif"

     

     

     

     

     

    column10.SortDescImageUrl =

     

    "~/App_Themes/MasterTheme/Skins/Master/Desc.gif"

     

     

     

     

     

    radGridImpact.MasterTableView.Columns.Add(column10)

     

     

    AddHandler radGridImpact.ItemDataBound, AddressOf rgvChangeImpactSummary_ItemDataBound

     

    ItemClicked.Items(0).Controls.Add(radGridImpact)

    BindChangeSummaryDetails(radGridImpact, ItemClicked.Value)

     

     

    End Sub

     

     

     

    'Get call plan values.

    Private

     

     

    Sub BindChangeSummaryDetails(ByVal radGrid As RadGrid, ByVal strTerritoryID As String)

     

     

     

    Dim sCallPalnValues As String

     

    Dim ds As DataSet

     

     

     

    Dim sTerrValue As String = String.Empty

     

     

     

    If strTerritoryID = "" Then

     

     

     

    Exit Sub

     

     

     

    End If

     

     

     

    'Get call plan values.

     

    ds =

     

    'some dataset

     

     

    If ds Is Nothing OrElse ds.Tables.Count = 0 Then

     

     

     

    'Dataset does not have any table.

     

    radGrid.DataSource =

     

    Nothing

     

    radGrid.DataBind()

    SbShowGridHeader(radGrid)

     

     

    Exit Sub

     

     

     

    End If

     

     

     

    If ds.Tables(0).Rows.Count = 0 Then

     

     

     

    Dim dr As DataRow = ds.Tables(0).NewRow()

     

    dr(0) =

     

    "No Data"

     

    dr(1) = 1234

    ds.Tables(0).Rows.Add(dr)

     

     

    End If

     

     

     

    With radGrid

     

    .Width =

     

    Unit.Percentage(100)

     

    .MasterTableView.Width =

     

    Unit.Percentage(100)

     

     

     

    ClsGeneral.setSkinPathToGrid(radGrid)

     

    .ClientSettings.Selecting.AllowRowSelect =

     

    True

     

    .AutoGenerateColumns =

     

    False

     

     

     

    'Sorting

     

    .AllowSorting =

     

    False

     

     

     

    'Set the paging always true and use the page_size to max

     

    .AllowPaging =

     

    True

     

    .AllowCustomPaging =

     

    True

     

     

     

    'Column Resizing

     

    .ClientSettings.Resizing.EnableRealTimeResize =

     

    False

     

    .ClientSettings.Resizing.ResizeGridOnColumnResize = bResizingEnabled

    .ClientSettings.Resizing.AllowColumnResize = bResizingEnabled

     

     

    'If bResizingEnabled = True Then

     

    .ClientSettings.Resizing.ClipCellContentOnResize = bResizingEnabled

    .PageSize = 20

    .DataSource = ds.Tables(0)

    .DataBind()

     

     

    End With

     

     

     

    End Sub

     

    Thanks
    Bhaskar

  2. bhaskar
    bhaskar avatar
    3 posts
    Member since:
    Jun 2007

    Posted 21 Nov 2011 Link to this post

    Dear Telerik Team,

    Please provide a reply and do the needful.
    It is an urgent issue.
    Whenever we put a radgrid into a panelbar with the panelbar inside a scrollable div, the grid header scrolls properly on vertical scrolling but the grid rows remain static.
    I want the grid header to remain static and grid rows to be scrollable.

    Regartds
    Bhaskar
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top