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

I've been trying to display a System.Drawing.Image (obtained from live camera feed snapshot) dynamically in a DataList control with asp:Image control but not having any success.

I was looking at RadBinaryImage to see if this is a viable option.

The images to be displayed are variable (aka dynamic number of images not static number/count) so I may have 5 images or 10 images or 7 images that are all System.Drawing.Image types.  I want to display those images in a Grid or DataList.


    <asp:DataList ID="cameras" runat="server" RepeatColumns="3" RepeatDirection="Horizontal" RepeatLayout="Table">
        <ItemTemplate>
            <asp:Image ID="cameraX" runat="server" />
        </ItemTemplate>
    </asp:DataList> 

 

In the ItemDataBound event handler I convert to byte array and assign to asp:Image ImageUrl ... but this results in nothing being displayed.  No errors, just nothing displayed.  Would RadBinaryImage be a solution?
        protected void cameras_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
        {
            
            Models.Facility.Camera camera = e.Item.DataItem as Models.Facility.Camera;
            Image img = GetImage(camera);
            MemoryStream ms = new MemoryStream();
            img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
            System.Web.UI.WebControls.Image imgControl = (System.Web.UI.WebControls.Image)e.Item.FindControl("camera");
            var base64Data = Convert.ToBase64String(ms.ToArray());
            imgControl.ImageUrl = "data:image/jpg;base64," + base64Data;

        }
Cheers, Rob.

 

Rob
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 17 Jan 2023
1 answer
159 views
Good day,

An error is thrown when I set the RetainExpandStateOnRebind = "True" after a partial postback. Here's the sample code that replicate the issue.

Scenario: selecting a row (with collapsed detail) 
Attila Antal
Telerik team
 answered on 16 Jan 2023
1 answer
202 views

hello, I'm using RadSpreadsheet and didn't figure out how to do the following:

1. In SpreadsheetTool Name="InsertCells", Can I change the default tool that appear to be other than "Add Column left"?

2. When dragging down a cell it behaves like "Copy cell" , but if the cell include content that ends with a digit the dragging will cause a "Fill Series" behavior, which means the new cell will have the prev cell value increased by 1, is there a way to control this default behavior and config it to be only "copy cell" with no increments??

Thanks,

Efrat

 
Rumen
Telerik team
 answered on 13 Jan 2023
1 answer
93 views

I allow the user to create in runtime, zones (my sections) and docks.

<asp:Repeater ID="repSections" runat="server" OnItemDataBound="repSections_ItemDataBound">
        <ItemTemplate>
            <asp:Panel ID="panelSection" runat="server" CssClass="container">
		
			A RadDockZone(section) and it's RadDocks are injected here in runtime...

		</asp:Panel>
        </ItemTemplate>        
    </asp:Repeater>

This repeater is populated from database and zones and it's docks injected in runtime, assigning the DockPositionChanged event to each of the created docks. Since I also inject in runtime, controls before and after each zone to manage it (Add, configure, move up/down) and I want them to postback using ajax, I'm configuring the ajax behavior in the ItemDataBound event of the Repeater:

protected void repSections_ItemDataBound(object sender, RepeaterItemEventArgs e)

{

LinkButton linkbtAddNormalSection = e.Item.FindControl("linkbtAddNormalSection") as LinkButton;
linkbtAddNormalSection.CommandArgument = section.Id.ToString();
AjaxSetting ajaxSetting_linkbtAddNormalSection = new AjaxSetting();
ajaxSetting_linkbtAddNormalSection.AjaxControlID = linkbtAddNormalSection.UniqueID;
ajaxSetting_linkbtAddNormalSection.EventName = "Click";
ajaxSetting_linkbtAddNormalSection.UpdatedControls.AddRange(new AjaxUpdatedControlsCollection()
{
 new AjaxUpdatedControl(repSections.UniqueID,""),
                            new AjaxUpdatedControl(panelNosections.UniqueID,""),
                            new AjaxUpdatedControl(radNotification.UniqueID, "")
});
ajaxManagerProxy.AjaxSettings.Add(ajaxSetting_linkbtAddNormalSection);

...

}

Because of this, RadAjax places a RadAjaxPanel that includes all the created zones inside of the repeater causing the DockPositionChanged event to function in ajax mode. That's fine, and works great since avoids a regular postback each time a dock changes position. 

The issue is that I need to show a RadNotification that is outside the repeater and consequently, outside that RadAjaxPanel and I can't show it from the  DockPositionChanged event. 

Any suggestion to overcome this?

 

Thank you!

Hugo Augusto
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 13 Jan 2023
0 answers
127 views

I have this control with EnableDescriptionField="true". The issue is if I enter the html contents in this description field or subject field and hit either Save or Cancel. the attached error happens. Is there a way to strip off the html tags or allow the html inputs to be entered?

I also tested this with the demo below. It did not work either.

https://demos.telerik.com/aspnet-ajax/scheduler/examples/month-view/defaultvb.aspx

 

Thanks,

Bob

Bob
Top achievements
Rank 1
 updated question on 12 Jan 2023
1 answer
181 views

The subject pretty much says it all...how do you get RadSpreadsheet to act like Excel when trying to auto resize all columns.  In Excel you select the upper left most cell, to the left of A1 and it will select the whole spreadsheet.  Next you put the cursor between 2 of the columns and get the "resize" cursor then you double click and all the columns will auto resize according to content. 

How do I get a RadSpreadsheet to do that, or is that not an available function?

Valentin Dragnev
Telerik team
 answered on 11 Jan 2023
6 answers
808 views
Hi,
 How can i hide Add and delete buttons while file uploading in progress.?
 Once the file uploading is completed then i want to show those buttons.

Thanks,
Jagadeeswararao Chappa.

 
pratichi
Top achievements
Rank 1
Iron
 answered on 06 Jan 2023
1 answer
86 views

Language="VB"

<%@ Register Src="../App_API/PatientInfo.ascx" TagName="PatientInfo" TagPrefix="ucl" %>

<ucl:PatientInfo ID="PatientInfoUserControl" runat="server" />

In CodeBehind

Dim AssignedPathologist As RadComboBox = CType(PatientInfoUserControl.FindControl("AssignedPathologistRadComboBox"), RadComboBox)
Dim AssignedPathologistText As String = AssignedPathologist.text
Dim AssignedPathologistValue As String = AssignedPathologist.value

Getting : error BC30456: 'value' is not a member of 'Telerik.Web.UI.RadComboBox'.

Wei
Top achievements
Rank 1
Iron
 answered on 06 Jan 2023
1 answer
123 views

Hi,

 

The Gantt tooltip's time format differs from the format in the task dialog.

Please refer to attached screenshots...can this be changed?

 

Marc

Attila Antal
Telerik team
 answered on 03 Jan 2023
2 answers
211 views
I have been trying for a couple of days now to get my PanelBar working with databound items, where the item template consists of a user control.  Here is my code:

<telerik:RadPanelBar runat="server" ID="pbSupplierAgreements" AllowCollapseAllItems="true"                 OnItemDataBound="pbSupplierAgreements_ItemDataBound" ExpandMode="SingleExpandedItem"                        Width="100%" DataValueField="ID" DataTextField="SupplierCode" DataTextFormatString="Supplier: {0}">
  <ItemTemplate>
    <telerik:RadPanelItem>
      <Items>
        <telerik:RadPanelItem>
          <ItemTemplate>
            <e:SupplierAgreementView ID="SupplierView" runat="server" />
          </ItemTemplate>
        </telerik:RadPanelItem>
      </Items>
    </telerik:RadPanelItem>
  </ItemTemplate>
</telerik:RadPanelBar>

When the OnItemDataBound is called I bind the data item to the SupplierAgreementView control.

The problem is that this renders the control and data ok , but the panel bar items are all expanded but I can't collapse them and there is no collapse button on the panel bar item headers.

Please help!
Attila Antal
Telerik team
 answered on 29 Dec 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?