Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
143 views

I need to display some pictures, between 1 and 40 or 50, and let the users select one or more of them.

Does Telerik have control that does a good job of this?

The imageGalary looks good but I don't see any way to select an image.

https://demos.telerik.com/aspnet-ajax/controls/examples/integration/listviewsliderwindowrotator/defaultcs.aspx

Any suggestions?

Bernie

 

 

 

Bernie
Top achievements
Rank 1
Iron
Iron
 asked on 09 Apr 2023
1 answer
137 views

Dont need to show me how. It would be appreciated, but at 1st I need to know if it is possible to on the client iterate through rows on a RadGrid and change the selected item of a RadComboBox in each row.  It isnt our ultimate goal. We want when a parent row is changed for all the comboboxes in the child to get changes to the same, but the code below is a start.

I try this and no visible change is made in the grid.

 

for (var i = 0; i < Telerik.Web.UI.RadComboBox.ComboBoxes.length; i++) {
    var combo = Telerik.Web.UI.RadComboBox.ComboBoxes[i];

     var item = combo.findItemByText(changedValue);
     if (item) {
           item.select();
                    }
                }
for (var i = 0; i < Telerik.Web.UI.RadComboBox.ComboBoxes.length; i++) {
                    var combo = Telerik.Web.UI.RadComboBox.ComboBoxes[i];

                    var item = combo.findItemByText(changedValue);
                    console.log(item);
                    if (item) {
                        item.select();
                    }
                }

Attila Antal
Telerik team
 answered on 07 Apr 2023
1 answer
218 views
I'm trying to use the PDFViewer to preview a PDF of the radgrid export on my page, but I can't find how I would export the radgrid PDF to a filesteram instead of directly to teh browser.  Is this possible?
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 07 Apr 2023
3 answers
635 views

I want to add a watermark to the pdf file to be displayed in pdfviewer.

Please inquire if it is possible.

Yoan
Telerik team
 answered on 07 Apr 2023
0 answers
139 views
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TabInputs.aspx.cs" Inherits="TabInputs" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <script>
            function OnClientTabSelected(sender, eventArgs) {
                var tab = eventArgs.get_tab();
                var htmlShow = document.getElementById("divProgressBar");
                    htmlShow.style.display = "block";
            }
            function OnClientMouseOut(sender, eventArgs) {
                var tab = eventArgs.get_tab();
                var htmlShow = document.getElementById("divProgressBar");
                    htmlShow.style.display = "none";
            }
        </script>

        <div>
            <telerik:RadTabStrip ID="RadTabStrip1" RenderMode="Auto" runat="server"
                OnClientTabSelected="OnClientTabSelected" 
                OnClientMouseOut="OnClientMouseOut"  
                MultiPageID="RadMultiPage1" Skin="MetroTouch">
            </telerik:RadTabStrip>
            <telerik:RadProgressManager  runat="server" ID="rpm" />
            <div id="divProgressBar" runat="server" style="display: none; position: absolute; top: 180px; z-index: -1;">
                <telerik:RadProgressBar RenderMode="Auto"  runat="server" ID="RadProgressBar4" 
                    Indeterminate="true"> 
                </telerik:RadProgressBar>
            </div>
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
            </telerik:RadMultiPage>
        </div>
    </form>
</body>
</html>
Anatoly
Top achievements
Rank 1
Iron
 asked on 07 Apr 2023
0 answers
261 views

I've run into an issue using modal popups and controls on a page, and I've created a test scenario. What I'm trying to do is, when the user submits a form to save data to a database, the application first validates if everything is correct. If not, display a modal popup. This works find the first time I press "Save Data" in my test, but the 2nd time, any bound controls seem to lose their values. For example, the line -

Dim value As String = RadComboBox1.SelectedItem.Value

gives an 'Object reference not set to an instance of an object" error. Do I have to rebind every control on the page in the code-behind, or is there a better way to do this? Is this happening because I'm putting the RadWindowManager into the AjaxPanel? (I read a bit of documentation about it, but I couldn't clearly understand it).

EDIT: It also happens with another control (button) that does a postback. While rebinding does prevent the "Object Reference..." error, it loses its' selected value.


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="AjaxTest.aspx.vb" Inherits="ModalTest.AjaxTest" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            
            <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
            </telerik:RadScriptManager>

             <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue">
            </telerik:RadWindowManager> 
            
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            </telerik:RadAjaxPanel>

            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadButton1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>

            </telerik:RadAjaxManager>

            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" Skin="Default">                
            </telerik:RadAjaxLoadingPanel>

            <telerik:RadButton ID="btnSave" runat="server" Text="Save Data">
            </telerik:RadButton>

            <telerik:RadLabel ID="RadLabel1" runat="server">
            </telerik:RadLabel>
            <telerik:RadComboBox ID="RadComboBox1" Runat="server" DataSourceID="SqlDataSource1" DataTextField="Title" DataValueField="ID">
            </telerik:RadComboBox>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AppConnectionString %>" SelectCommand="SELECT [ID], [Title] FROM [luTest]"></asp:SqlDataSource>
        </div>
    </form>
</body>
</html>

 


Imports Telerik.Web.UI

Public Class AjaxTest
  Inherits System.Web.UI.Page
  Protected Sub RadButton1_Click(sender As Object, e As EventArgs) Handles btnSave.Click

    ' Simulate Data Validation.
    RadAjaxPanel1.Controls.Clear()
    RadAjaxPanel1.Controls.Add(RadWindowManager1)

    ' The commented out code also works, but the dropdown still loses its' values.
    RadWindowManager1.Windows.Clear()
    RadWindowManager1.RadAlert("Test Validation Message", 330, 180, "Error", "")

    ' CreateModalWindow(RadWindowManager1, "mModal\Modal.aspx")

    ' Simulating collecting data for saving to a database table.
    Dim value As String = RadComboBox1.SelectedItem.Value


  End Sub

  Private Sub CreateModalWindow(WindowManager As RadWindowManager, url As String)

    Dim RadWindow1 As New RadWindow
    With RadWindow1
      .ID = "rwTest"
      .Height = 600
      .Width = 800
      .Title = "Title"
      .DestroyOnClose = True
      .Skin = "WebBlue"
      .Modal = True
      .NavigateUrl = url
    End With

    WindowManager.Windows.Clear()
    WindowManager.Windows.Add(RadWindow1)

    Dim PageHandler As Page = HttpContext.Current.Handler

    Dim script As String = "function f(){$find(""" + RadWindow1.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"

    RadAjaxPanel1.ResponseScripts.Add(script)
    ScriptManager.RegisterStartupScript(PageHandler, PageHandler.GetType(), "key", script, True)

  End Sub

End Class

JenMaryland
Top achievements
Rank 1
 updated question on 06 Apr 2023
2 answers
361 views
I have an application that uses RadComboBoxes. I have noticed several issues regarding the width and labels. I have created two testing scenarios to demonstrate some of the
behavior. Also, I am using bootstrap in my application so to demonstrate the difference
in behavior between the two, I included examples of both. Attached are the pages rendered in Chrome.

 

 

Test 1 without Bootstrap:
Aspx:

<!DOCTYPE html>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

</head>

<body>

 

    <form id="form1" runat="server">

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

        <div class="container
vertical-center">

            <div class="row">

                <div class="col-sm-6
col-xs-12">

                    <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="50%" Label="50% With
Label:"></telerik:RadComboBox>

                    <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="100%" Label="100% With
Label:"></telerik:RadComboBox>

                    Label="100% w/o Label:
"

                    <telerik:RadComboBox ID="RadComboBox3" runat="server" Width="100%"></telerik:RadComboBox>

                    Label="50% w/o Label:
"<br />

                    <telerik:RadComboBox ID="RadComboBox4" runat="server" Width="50%"></telerik:RadComboBox>

                </div>

            </div>

        </div>

    </form>

</body>

</html>

 

Test 2
with bootstrap:
Aspx:

<!DOCTYPE html>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <link rel="stylesheet" href="~/content/bootstrap.min.css" />

    <link rel="stylesheet" href="~/content/bootstrap-theme.min.css" />

</head>

<body>

 

    <form id="form1" runat="server">

        <telerik:RadScriptManager ID="ScriptManager" runat="server">

            <Scripts>

                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>

                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>

                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>

                <asp:ScriptReference Path="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" />

                <asp:ScriptReference Path="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js" />

            </Scripts>

        </telerik:RadScriptManager>

        <div class="container
vertical-center">

            <div class="row">

                <div class="col-sm-6
col-xs-12">

                    <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="50%" Label="50% With
Label:"></telerik:RadComboBox>

                    <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="100%" Label="100% With
Label:"></telerik:RadComboBox>

                    Label="100% w/o Label:
"

                    <telerik:RadComboBox ID="RadComboBox3" runat="server" Width="100%"></telerik:RadComboBox>

                    Label="50% w/o Label:
"<br />

                    <telerik:RadComboBox ID="RadComboBox4" runat="server" Width="50%"></telerik:RadComboBox>

                </div>

            </div>

        </div>

    </form>

</body>

</html>





























Attila Antal
Telerik team
 updated answer on 06 Apr 2023
1 answer
192 views
I have added Mail Merge field and and try to add checkbox property using Telerik word processing. but not able to find the solution. and not able to extract Mail Merge fields also from word document.
Yoan
Telerik team
 answered on 05 Apr 2023
1 answer
274 views

We need to change the selected item of RadComboBox's hosted in RadGrid in BatchEdit mode.

We have a RadGrid with parent child relationships. If the parent row combobox is changed then the change needs to ripple through and change the same value in the child rows.  If a child row is changed the parent may need to be changed as well.

The parent can be set to "Multiple,Detailed,Deferred" and a couple other values. If the parent is changed to Detailed then all the children become detailed. If the parent is Detailed and one of the children is changed to something other than Detailed then the parent must change to Multiple. If all the children changed to the same value then the parent should be changed to that value as well.

We are triggering processing with the grid OnBatchEditSetCellValue client event.  

MasterTableView EditMode="Batch"

BatchEditSetting EditType="Cell"

 

Attila Antal
Telerik team
 answered on 05 Apr 2023
1 answer
176 views

Hi,

I'm trying to use the Treelist for a data source with the following definition

public class MyGridItem
{
	public string ID { get; set; }
	public string Name { get; set; }
	public string ParentID { get; set; }
	public bool IsIncluded { get; set; }
	public bool IsExcluded { get; set; }
}

In markup I've got


<telerik:RadTreeList ID="RadTreeMarkers" runat="server" ParentDataKeyNames="ParentID" DataKeyNames="ID" AutoGenerateColumns="false"
	OnNeedDataSource="RadTreeMarkers_NeedDataSource" AllowMultiItemEdit="true" ExpandCollapseMode="Client" EditMode="InPlace"
	AllowPaging="false" AllowSorting="false" OnItemDataBound="RadTreeMarkers_ItemDataBound">
	<Columns>
		<telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" Visible="false" ForceExtractValue="Always"></telerik:TreeListBoundColumn>
		<telerik:TreeListBoundColumn DataField="ParentID" UniqueName="ParentID" Visible="false"></telerik:TreeListBoundColumn>
		<telerik:TreeListBoundColumn DataField="Name" UniqueName="Name" HeaderText="Mark" ReadOnly="true"></telerik:TreeListBoundColumn>
		<telerik:TreeListCheckBoxColumn DataField="IsIncluded" UniqueName="IsIncluded" HeaderText="Included" ForceExtractValue="Always"></telerik:TreeListCheckBoxColumn>
		<telerik:TreeListCheckBoxColumn DataField="IsExcluded" UniqueName="IsExcluded" HeaderText="Excluded" ForceExtractValue="Always"></telerik:TreeListCheckBoxColumn>
	</Columns>
</telerik:RadTreeList>

And then in the code behind I've got
protected void RadTreeMarkers_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e)
{
	var treeData = MyFacade.GetTreeData();
	var treeDataGridItems = treeData.Select(m => new GridItem
	{
		ID = m.ID.ToString(),
		Name = m.Name,
		ParentID = m.ParentID.HasValue ? m.ParentID.Value.ToString() : string.Empty,
		IsIncluded = m.IsIncluded.HasValue && m.IsIncluded == true,
		IsExcluded = m.IsIncluded.HasValue && m.IsIncluded == false
	}
	).ToList();
	RadTreeMarkers.DataSource = treeDataGridItems;
}

protected void RadTreeMarkers_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
{
	if (e.Item is TreeListDataItem item)
	{
		item.Edit = true;
	}
}

The intention is for (only) the two checkboxes to be always editable in the client.

However, when rendered in the client the root items are editable but none of the child items is editable.

What am I doing wrong?

Doncho
Telerik team
 answered on 05 Apr 2023
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?