Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
127 views

Language : vb

I have a table that contains a numeric field. Using this field value I generate variable numbers of CheckBoxes in a RadGrid PlaceHolder :

I am attempting reference the CheckBoxes in the selected row and do some processing if the a CheckBox is checked.

I can get the reference to the PlaceHolder : Dim phBlocksCheckBox As PlaceHolder = DirectCast(item.FindControl("phBlocksCheckBox"), PlaceHolder)

But the code to return the CheckBox reference is returning Nothing : Dim BlockCheckBox As CheckBox = DirectCast(phBlocksCheckBox.FindControl("BlockCheckBox_" & cbIndex), CheckBox)

Here is my code :

apsx :
    <div style="clear: both">
        <div style="float: right; margin-right: 10px;">
            <asp:Button ID="GenerateButton" runat="server" Text="Generate Cassette Labels" Disabled="True"/>
        </div>
    </div>

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" GridLines="None" AllowMultiRowSelection="True" AllowFilteringByColumn="True" EnableLinqExpressions="False">
        <MasterTableView AutoGenerateColumns="False">
            <PagerStyle AlwaysVisible="True"></PagerStyle>
            <Columns>
                <telerik:GridClientSelectColumn UniqueName="checkboxColumn1" HeaderTooltip="SELECT All" ShowSortIcon="False" ShowFilterIcon="False" Reorderable="False">
                    <HeaderStyle Width="30px" />
                </telerik:GridClientSelectColumn>
                <telerik:GridBoundColumn DataField="NumberOfBlocks" HeaderText="Block Count" UniqueName="NumberOfBlocks" AllowFiltering="False" Display="False">
                    <HeaderStyle Width="20px" />
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn DataField="Block" HeaderText="Blocks" UniqueName="Blocks" AllowFiltering="False">
                    <ItemTemplate>
                        <asp:PlaceHolder ID="phBlocksCheckBox" runat="server" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>


vb :
    Public dt As DataTable = Nothing
    Protected Sub RadGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        If dt Is Nothing Then
            Dim objRadGrid As RadGrid = CType(sender, RadGrid)
            Dim objCommand As New MySqlCommand
            dt = New DataTable()

 
            objCommand.CommandText = "SELECT Block AS NumberOfBlocks FROM samples"
            Call DBClass.TapDB("ConnStr", objCommand, "getRS", "", dt)

            objRadGrid.DataSource = dt
        End If
    End Sub

    Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemDataBound
        'Ensure we are dealing with a data item (not header, footer, etc.)
        If TypeOf e.Item Is GridDataItem Then
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)

            'Find the placeholder control defined in the ItemTemplate
            Dim phBlocksCheckBox As PlaceHolder = CType(item.FindControl("phBlocksCheckBox"), PlaceHolder)

            If phBlocksCheckBox IsNot Nothing Then
                Dim NumberOfBlocks As Integer = DataBinder.Eval(item.DataItem, "NumberOfBlocks")

                'Dynamically create and add checkboxes
                If NumberOfBlocks > 0 Then
                    For BlockIndex As Integer = 0 To NumberOfBlocks - 1
                        Dim BlockCheckBox As New CheckBox()
                        BlockCheckBox.ID = "BlockCheckBox_" & (BlockIndex + 1).ToString()
                        BlockCheckBox.Text = (BlockIndex + 1).ToString()
                        BlockCheckBox.Checked = True
                        phBlocksCheckBox.Controls.Add(BlockCheckBox)
                        phBlocksCheckBox.Controls.Add(New LiteralControl("    "))
                    Next
                End If
            End If
        End If
    End Sub


    Protected Sub Button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles GenerateCassetteLabelsButton.Click
        Dim NumberOfBlocks As Integer = 0

        For Each item As GridDataItem In RadGrid1.SelectedItems
            NumberOfBlocks = CInt(item("NumberOfBlocks").Text)

            Dim phBlocksCheckBox As PlaceHolder = DirectCast(item.FindControl("phBlocksCheckBox"), PlaceHolder)
            If phBlocksCheckBox IsNot Nothing Then
HttpContext.Current.Response.Write("phBlocksCheckBox IsNot Nothing<br><br>")
                For cbIndex As Integer = 1 To NumberOfBlocks
HttpContext.Current.Response.Write("-BlockCheckBoxID : " & "BlockCheckBox_" & cbIndex & "<br><br>")
                    Dim BlockCheckBox As CheckBox = DirectCast(phBlocksCheckBox.FindControl("BlockCheckBox_" & cbIndex), CheckBox)

                    If BlockCheckBox IsNot Nothing Then
HttpContext.Current.Response.Write("BlockCheckBox IsNot Nothing<br><br>")
                        'Do something with BlockCheckBox.Text
HttpContext.Current.Response.Write("Block : " & BlockCheckBox.Text & "<br><br>")
                    End If
                Next
            End If
        Next

        RadGrid1.Rebind()
    End Sub

 

Vasko
Telerik team
 answered on 02 Mar 2026
1 answer
166 views

Hi , 

We have client facing issue where the RadTreeView control nested under RadComboBox is exceeding the popup space and having a page scroll how can i restrict it ?   Also  RadTreeview Nested under is not detecting the screen boundary and expanding the direction

Vasko
Telerik team
 answered on 23 Feb 2026
1 answer
43 views

Hi , 

I’m working on aligning the loading dropdown that renders under rcbSlide with the width of the RadComboBox, even when an additional icon is present. Since rcbSlide resides outside the RadComboBox container, I need guidance on how to ensure the dropdown inherits or matches the RadComboBox width consistently.

Vasko
Telerik team
 answered on 09 Feb 2026
1 answer
31 views

I have a simple TreeView

    <telerik:RadTreeView ID="radTreeViewIndex" runat="server">
                    </telerik:RadTreeView>

That I am databinding on the page load.

My query returns heirarchical records such as the following

SPOP   TheKey     SYear     Norder

Null        A             Adult          4000
Null        P             Pediatric    3000
A            A2022     2022          2500
A            A2021      2021         2500
A           A2020      2020        2500
P            P2022     2022          2000
P            P2021      2021         2000
P           P2020      2020        2000

On the page load, I call the Oracle query, get back a cursor and construct the treeview by binding a data table to it

        DataTable dt1 =
            new DataTable();
        da1.Fill(dt1);
        RadTreeView radTreeViewIndex = (RadTreeView)FindControl("radTreeViewIndex");
        radTreeViewIndex.NodeDataBound += new RadTreeViewEventHandler(radTVI_click);
        radTreeViewIndex.DataFieldParentID = "SPOP";
        radTreeViewIndex.DataFieldID = "theKey";
        radTreeViewIndex.DataTextField = "sYear";
        radTreeViewIndex.DataValueField = "sYear";

        radTreeViewIndex.DataSource = dt1;
        radTreeViewIndex.DataBind();

The tree expanded would look like

> Adult

      - 2022 

     -  2021

     -  2020

> Pediatric

      - 2022 

     -  2021

     -  2020

The databinding and expanding/collapsing is working fine

That I am trying to now do and figure out how best to do is to navigate and load a grid based upon the click of a year

So clicking on Adult or Pediatric Nodes would only expand or collapse the tree
Clicking on the Year node would then call an event that would pass in the population and the year and then load that grid (to the right of the tree)  So for clicking on (Adult > 2021 ) node - was thinking navigating back to the page witth these values set, the tree expanded to show the selected node and the grid populated to display the records for population = adult and year = 2021

I was thinking I would add the event to the NodeDataBound

    protected void radTVI_click(object sender, RadTreeNodeEventArgs e)
    {
        if (string.IsNullOrEmpty(e.Node.NavigateUrl))
            e.Node.Attributes["onclick"] = "return Redirect(https://myjunkurl.com);";

    }

And then work with it to basically ignore or only have expand or collapse on the clicks of Adult or Pediatric but otherwise generate the URL to call the page and pass in the SPop and Year to then load the tree and grid.

Rumen
Telerik team
 answered on 05 Feb 2026
1 answer
43 views

Hi The following Web resource is not loading with the latest telerik version 2024.****. and affecting pagination.  Can you please help if there is any css or C# code that may affect. 

The application is built on asp.net 4.8 webforms.  Also could you kindly treat it as high priority as its impacting clients.  

Issue :  The height and space margins are varying. 

Kindly let us know if you need further details 

Best Regards, 

Sunil Shankar S R

Rumen
Telerik team
 answered on 05 Feb 2026
3 answers
46 views

I am trying to figure out how to accomplish this.  I am not sure if the RadGrid is best use

I have a data query that will return one or more records

Example - data returned may look like

UserID, User Full Name, User Status, Hire Date, Manager Name, Location, Skill Set, Last Review

And I want to format it as

Record 1

Row - User ID, User Full Name, User Status, Hire Date, Manager Name

Row - Location, Skill Set, Last Review

Next Record

Row - User ID, User Full Name, User Status, Hire Date, Manager Name

Row - Location, Skill Set, Last Review

Etc. 

I no problem filling data adapter, filling data table and then binding to grid in single row to record, but setting up multiple rows per record I am struggling. 

Thanks

Rumen
Telerik team
 answered on 03 Feb 2026
1 answer
39 views
Is there a JQuery version requirement for using the Telerik Web UI Controls in an ASP.Net Web Forms project?  I see the .NET 4.6.2+ but no JQuery version.
Rumen
Telerik team
 answered on 22 Jan 2026
1 answer
54 views

Hello

I have a page that is ajaxed using Ajax Manager.  There is a RadWindow on the page which uses navigateurl rather than contenttemplate to show a page within the site (so not an external URL)

That page also has AjaxManager on it.  When an ajaxed field within the window is changed the page does a partial postback correctly (and updates whatever it needs to do on itself) however the scroll position of the parent page scrolls to the top.

How do I stop that from happening?

I note that I am using this to scroll back to the window on window load because on opening the window it would scroll to the top as well

  function fnRadWindowPageLoad() {
                if (modalPopUpScrollPositionObj != null)
                    window.scrollTo(modalPopUpScrollPositionObj.XCoordinate(), modalPopUpScrollPositionObj.YCoordinate());
            }

 

I'm using this to open the window in the code behind, after I've done some processing

Dim sbScript As New System.Text.StringBuilder()

        'This needs the Sys.Application.Load event, as the button performs a full postback, thus disposes the entire user control, as well as the page
        sbScript.Append("function f(){")
        sbScript.Append("var oWnd = $find('" & RadWindowSearchFilter.ClientID & "');")
        sbScript.Append("oWnd.show();")
        sbScript.Append("Sys.Application.remove_load(f);")
        sbScript.Append("}")
        sbScript.Append("Sys.Application.add_load(f);")
        ScriptManager.RegisterStartupScript(Page, Me.GetType(), "key", sbScript.ToString(), True)
Rumen
Telerik team
 answered on 21 Jan 2026
1 answer
57 views

Hi sir

     I use RadAjaxManager in master page  i call the RadAjaxManager in master.js file. in Grid itemdatabound call the function

 

if (gridid.toString().toLowerCase().indexOf("explorergrid") >= 0) {
    $("#ContentPlaceHolder1_ExplorerGridSelectedIndexHidden").val(index);
    var ajaxManager = $find('ctl00_RadAjaxManager1');
    ajaxManager.ajaxRequestWithTarget('ctl00$ContentPlaceHolder1$explorerGridViewLink', '');
}

 

when click the grid i got the error in png 

 

Vasko
Telerik team
 answered on 16 Jan 2026
2 answers
40 views

Hello.
I am using ASP.NET Framework, and in the Telerik.Reporting.Graph section I have a chart that is populated by a stored procedure.
The output of my stored procedure has three columns: DayOfMonth, ProductionType, and Value, and it is structured as follows.

 

DayOfMonthProductionTypeValue
1Staple1244
1SumAll3066.2
1Tow1822.2
2Staple624.9
2SumAll3984.6
2Tow3359.7
3Staple1865.38
3SumAll5126.18
3Tow3260.8

ProductionType has three values: Tow, Staple, and SumAll.

I need SumAll to be displayed as a line chart, and Tow and Staple to be displayed as bar (column) charts within the same chart.
DayOfMonth should be displayed horizontally on the X-axis and represent the days of the month.

No matter how much I tried, I could not limit the ProductionType values in the line chart using the filters in:

  • series < lineSeries1 < GraphGroup < Filters

  • series < SeriesGroup < Filters

so that only ProductionType = SumAll is shown in the line chart.

The only place where I managed to apply this filter was in:

  • Data < SeriesGroup < Filters

but that filters the entire dataset, causing the bar chart to be filtered as well.

Please help me with this issue.
A sample of my code is attached.

Thank you.

Mohamad Javad
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 06 Jan 2026
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?