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

Hey,

My problem is that I'm trying to create a RadTileList programmatically to populate an Intranet staff page.

We've developed a page in which users can choose an image of themselves, along with fill out the details we don't keep in Active Directory, and then we pull the photo, AD information and profile information and pop it into a staff page. Works beautifully, and the Telerik controls really improve the look and feel of it.

Then we wanted to make a series of image galleries for different teams, different job roles etc. We can pull the data for these groups no problem. Then the plan is that everyone gets their image put into a gallery, which we're going to use the RadToolTip functionality on to preview before they can open the page to learn all about the member of staff. Herein lies my problem, because I can't populate the RadTileList using the byte array (byte[]) images.

Below is an example of how I'm TRYING to code it. Unfortunately I have so much to do on this project and so little time to do it in that I really can't afford to be spending much longer trying to get this to work. Any chance you could provide a solution?

protected void LoadStaffList(DataTable staffList, Image notAvailable)
{
    var tileList = new RadTileList();
    var tileGroup = new TileGroup();
    var memoryStream = new MemoryStream();
    var image = Resources.photonotavailable;
    image.Save(memoryStream, ImageFormat.Png);
 
    foreach (DataRow row in staffList.Rows)
    {
        var imageTile = new RadImageTile();
        var userPhoto = row["UserPhoto"] != DBNull.Value ? row["UserPhoto"] : null;
        imageTile.DataItem = (byte[]) userPhoto ?? memoryStream.ToArray(); <-- YOU CAN'T DO THIS!!
        imageTile.Shape = TileShape.Square;
        tileGroup.Tiles.Add(imageTile);
    }
 
    tileList.Groups.Add(tileGroup);
    divTeamInformation.Controls.Add(tileList);
}

I'm assuming there's a way to use a RadBinaryImage or something else in place of the RadImageTile? Or some other way to set the data without writing the byte array to a temp file and then setting the temp file as the Image Source, because both of those would be incredibly annoying to have to do.

Any help you could provide would be massively appreciated. Apologies if it's a duplicate topic but I couldn't see one like it.

Thanks,

-Alexis

Marin Bratanov
Telerik team
 answered on 26 Jul 2017
1 answer
137 views

We have a custom application that creates a Telerik RadHtmlChart object from an external DLL method.

We also have a second custom application that uses MVC and Kendo components.

I understand that both RadHtmlChart and Kendo charts are using the same underlying server-side wrapper from the Kendo UI chart widgets.

My question is, how can I request that same external DLL using MVC/razor, and have it sent back to my view as a Kendo Chart? Is this possible? 

Vessy
Telerik team
 answered on 26 Jul 2017
1 answer
123 views

The filters properly clean the attached image when IE protected mode is OFF:

However if IE protected mode is ON, the alert runs. I have verified this in the DEMO editor as well.

 

 

Christopher
Top achievements
Rank 1
 answered on 26 Jul 2017
11 answers
378 views
Hi, I've downloaded Telerik UI for ASP.NET AJAX and interested in Gantt chart control (Telerik_UI_for_ASP.NET_AJAX_Setup_2014_2_724.zip). I was wondering how to change task color individually based on status (finished = green, on progress = blue, overdue = red). Is it possible with the current beta version? When is the final version will be released? Thank you.
Peter Milchev
Telerik team
 answered on 26 Jul 2017
6 answers
284 views

Hello, All

I have one issue in my current page , when i am working in RadGrid and I have created grid dynamically and try handle item command event by writing my code as below mention but not working
I want to create nested grid on clic

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="demotemp.aspx.cs" Inherits="HcareTemplate.demotemp" MasterPageFile="HTemplateMaster.Master" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
</asp:Content>
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace HcareTemplate
{
    public partial class demotemp : System.Web.UI.Page
    {
        HcareTemplate.HcareTemplateService objService = new HcareTemplate.HcareTemplateService();
        DataSet datalist;
        public void DefineGridStructure()
        {
            RadGrid RadGrid1 = new RadGrid();
            RadGrid1.ItemCommand += new GridCommandEventHandler(RadGrid1_ItemCommand);
            RadGrid1.ID = "RadGrid1";
            datalist = objService.getSoapTemplateQuestions(1, 16);
            RadGrid1.DataSource = datalist;
            RadGrid1.MasterTableView.DataKeyNames = new string[] { "TemplateId" };
            RadGrid1.Skin = "Outlook";
            RadGrid1.Width = Unit.Percentage(30);
            RadGrid1.AllowPaging = true;
            RadGrid1.AutoGenerateColumns = false;
            RadGrid1.ClientSettings.Selecting.AllowRowSelect = true;
            //Add columns
            GridBoundColumn boundColumn;
            boundColumn = new GridBoundColumn();
            boundColumn.DataField = "TemplateId";
            boundColumn.HeaderText = "TemplateId";
            RadGrid1.MasterTableView.Columns.Add(boundColumn);
            boundColumn = new GridBoundColumn();
            boundColumn.DataField = "ProviderText";
            boundColumn.HeaderText = "ProviderText";
            RadGrid1.MasterTableView.Columns.Add(boundColumn);
            this.PlaceHolder1.Controls.Add(RadGrid1);
        }
 
        public void Page_Init(object sender, System.EventArgs e)
        {
            DefineGridStructure();
        }
 
        public void Page_Load(object sender, System.EventArgs e)
        {
            RadGrid grid = (RadGrid)PlaceHolder1.FindControl("RadGrid1");
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(grid, grid);
 
        }
        public void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "RowClick")
            {
 
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "test", "<script>alert('hi');</script>");
                GridEditableItem item = e.Item as GridEditableItem;
                int ParentId = Convert.ToInt32(item.GetDataKeyValue("TemplateId"));
                DataSet ds = objService.getTemplateProiderText(ParentId);
                
                datalist = objService.getSoapTemplateQuestions(1, ParentId);
                if (datalist.Tables[0].Rows.Count > 0)
                {
                    DefineGridStructure();
                }
            }
        }
    }
}

k on selected row of current grid

Swati
Top achievements
Rank 1
 answered on 26 Jul 2017
2 answers
138 views

Hello,

I have a RadGrid with a DropDownList in its edititem Template area.

I would like to color the items depending on Org Name.

 

Here is the RadGrid definition  (I just removed columns before and after for ease of reading)

<telerik:RadGrid ID="RadExamGrid" runat="server" AutoGenerateColumns="False"
                 AllowSorting="True"  ExportCellFormating="RadExamGrid_ExportCellFormatting"
                 GridLines="Both" EnableViewState="True"
                MasterTableView-AllowSorting="True" PagerStyle-AlwaysVisible="True"
                  PagerStyle-Position="TopAndBottom" ResolvedRenderMode="Classic"
                  OnNeedDataSource="RadExamGrid_NeedDataSource" Skin="Sunset" >
                 <ExportSettings ExportOnlyData="True" FileName="Allocation"
                    HideStructureColumns="True" OpenInNewWindow="True" Excel-FileExtension="xls" Excel-Format="Biff" SuppressColumnDataFormatStrings="True">
                    <Excel Format="Biff" />
                </ExportSettings>
                <MasterTableView AllowPaging="True" PageSize="10" CommandItemDisplay="Top" Caption="Exams Received"
                InsertItemPageIndexAction="ShowItemOnCurrentPage" DataKeyNames="EntryNum" OverrideDataSourceControlSorting="True" CommandItemSettings-ShowExportToExcelButton="True" CommandItemSettings-ShowExportToPdfButton="False" CommandItemSettings-ShowExportToWordButton="True" >
 
                    <Columns>
<%   COLUMNS before not included %>
                    
 
                      <%--Org No Column --%>
                    <telerik:GridTemplateColumn HeaderText="Org Name" SortExpression="OrgName" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="250px">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "OrgName")%>
                        </ItemTemplate>
                       <EditItemTemplate>     
                            <telerik:RadDropDownList ID="RadddlOrg" runat="server" AutoPostBack="True" Width="300px" DataTextField="OrgName" DataValueField="OrgNo" SelectedValue='<%# DataBinder.Eval(Container.DataItem, "OrgNo")%> ' OnSelectedIndexChanged="RadddlOrg_SelectedIndexChanged" CausesValidation="false">
                            </telerik:RadDropDownList>
                     
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Field is required" ControlToValidate="RadddlOrg" Display="Static" Font-Bold="True" SetFocusOnError="True" ForeColor="#FF0000"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
 
<%   COLUMNS after not included %>
            
                    </Columns>
 
                    <EditFormSettings EditColumn-ButtonType="PushButton">
                        <EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
                            UniqueName="EditCommandColumn1">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <PagerStyle Position="TopAndBottom" />
            </telerik:RadGrid>

 

 

Here is my RadGrid Item DataBound method.

 

Protected Sub RadExamGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadExamGrid.ItemDataBound
        Dim cmdItem As GridCommandItem = DirectCast(RadExamGrid.MasterTableView.GetItems(GridItemType.CommandItem)(0), GridCommandItem)
        Dim intResult As Integer = 0
 
        If TypeOf e.Item Is GridDataItem Then
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
            Dim btnDelete As ImageButton = DirectCast(item("ReceivedCommand").Controls(0), ImageButton)
            Dim itemValue As String = item.DataItem("RCVDTS")
            If itemValue.Trim = "" Then
                btnDelete.Visible = True
            Else
                btnDelete.Visible = False
            End If
 
        End If
 
        ''want dropdownlist for edit;
        If TypeOf e.Item Is GridEditableItem And e.Item.IsInEditMode Then
            Dim editItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
            Dim drpOrg As Telerik.Web.UI.RadDropDownList = DirectCast(editItem.FindControl("RadddlOrg"), Telerik.Web.UI.RadDropDownList)
            Dim txtStudno As Telerik.Web.UI.RadTextBox = DirectCast(editItem.FindControl("RadtxtStudNo"), Telerik.Web.UI.RadTextBox)
 
            For i = 0 To objEXR.OrgNameDataView.Count - 1
                Dim li As New DropDownListItem
                li.Value = objEXR.OrgNameDataView.Item(i).Item(0)
                li.Text = objEXR.OrgNameDataView.Item(i).Item(1)
                If li.Text.Trim = "4HR CHALLENGER EXAM SESSION" Then
                    li.ForeColor = System.Drawing.Color.Blue
                End If
                drpOrg.Items.Add(li)
            Next
 
            If txtStudno.Text.Trim = "" Then
                txtStudno.Text = "1"
            End If
 
 
        End If
 
 
 
    End Sub

 

I read some articles on RadDropDownList.VisualListItemFormatting Event, but was unsuccessful to implement it.  I went with simple approach to create list item, and then set its forecolor.   Thanks in advance for any help.  

 

Jason
Top achievements
Rank 1
 answered on 25 Jul 2017
1 answer
91 views

Hi

How can I stop the Label1 disappearing on OnTextChanged?

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Textbox1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Label1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
    <Windows>
    <telerik:RadWindow ID="RadWindow1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server">
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <telerik:RadTextBox runat="server" ID="Textbox1" OnTextChanged="Textbox1_TextChanged" AutoPostBack="True"></telerik:RadTextBox>
            </asp:Panel>
        </ContentTemplate>
    </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
 
    protected void Textbox1_TextChanged(object sender, EventArgs e)
    {
        if (sender is RadTextBox)
        {
            RadTextBox tb = (RadTextBox)sender;
            string message = "<strong>OnTextChanged</strong> event fired: Value has changed to: <em>\"" + (sender as RadTextBox).Text + "\"</em>";
            Label1.Text = message;
        }
    }

 

 

Thankyou

Andy

 

 

 

Vessy
Telerik team
 answered on 25 Jul 2017
7 answers
474 views

Hello,

I have two grids with EditMode="Batch".  Both grids subscribe to the OnBatchEditCommand event for saving data.  I am trying to save data from both of these grids, as well as data from other controls on the page with one button click. 

I have tried suggestions from http://www.telerik.com/forums/save-radgrid-in-batcheditmode-from-external-button and http://www.telerik.com/forums/how-do-i-save-2-radgrids-by-only-1-outside-button but can't seem to achieve the desired functionality...  Is this possible?

Thank you in advance.

Amy

 

Kathleen Johnson
Top achievements
Rank 1
 answered on 25 Jul 2017
2 answers
300 views

i am running sharepoint 2013 in a dev environment. when i restart the application server, all of my web applications show a 505 error. when i look in the web config of each web application i see the following. once i remove or comment out one of the lines, my web applications work fine until i restart the application server, then the second entry is re added to the web config of each of the web applications

<add name="Telerik.Web.UI.WebResource.axd_*" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2015.1.225.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode" />
      <add name="Telerik.Web.UI.WebResource.axd_*" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2015.2.624.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode" />

Robert
Top achievements
Rank 1
 answered on 25 Jul 2017
1 answer
70 views

I'm trying to find the best way to configure my radgrid to accomplish this scenario.

Here is the scenario:

(This all occurs within my Default.aspx page)

1. A radtextbox control prompts the user to input the customer number.  The customer number is validated using data coming from a table adapter.

 

2. I want to pass the customer number entered above into another query (table adapter) and return a item details dataset using it.  This is the dataset

that I want my RadGrid connected to. 

-------------------

I have been able to figure out how to accomplish everything above by using the RadGrid (onneeddatasource) event. 

Here is where my problem comes in:

---------------------

3.  One of the columns in my item details dataset (column name PRINT) is a Boolean datatype.   I have set the PRINT column in my datatable associated with the table adapter to read-only = false.  I need to give the user ability to (check or un-check) that column in my RadGrid and have it update the datatable only.  I have no requirement to go back and update the SQL database with the updated datatable.   This data is going to be used to generate a sql report which is included in this project.  

In summary, I haven't been able to find a way to query and store results in a local datatable and allow the radgrid to update that local datatable.  I've looked at the batch editing capability, but I don't like the way it requires having to press the save button in between paging.  I'd like to code it so that the user can click the check box and it immediately saves the result to the data table.  

Is there anyone out there that can give me some advice or an example of how I can accomplish this problem?

 

Marin Bratanov
Telerik team
 answered on 25 Jul 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?