Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
378 views
I have in my aspx page the following structure where i load the data from a datatable.

<telerik:RadBinaryImage runat="server" ID="rbiTeste" AutoAdjustImageControlSize="true" />
  
<telerik:RadGrid runat="server" ID="radGridUsuarios" GridLines="None" ShowFooter="False"
    AllowSorting="True" ShowGroupPanel="False" AutoGenerateColumns="False" AllowPaging="True"
    OnPreRender="radGridUsuarios_PreRender" OnNeedDataSource="radGridUsuarios_NeedDataSource"
    OnItemCommand="radGridUsuarios_ItemCommand" OnItemDataBound="radGridUsuarios_ItemDataBound"
    PageSize="30">
    <MasterTableView DataKeyNames="ID_USUARIO" EnableHeaderContextMenu="False" AllowMultiColumnSorting="False">
        <Columns>
            <telerik:GridBoundColumn DataField="ID_USUARIO" HeaderText="Id" SortExpression="ID_USUARIO" Visible="false" />
            <telerik:GridBoundColumn DataField="USU_NOME" HeaderText="Nome" SortExpression="USU_NOME" />
            <telerik:GridBoundColumn DataField="SEX_DESC" HeaderText="Sexo" SortExpression="SEX_DESC" />
            <telerik:GridBoundColumn DataField="USU_EMAIL" HeaderText="E-mail" SortExpression="USU_EMAIL" />
            <telerik:GridBoundColumn DataField="USU_DTNASC" HeaderText="Aniversário" SortExpression="USU_DTNASC" DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" />
            <telerik:GridBoundColumn DataField="USU_DTCADASTRO" HeaderText="Data de Cadastro" SortExpression="USU_DTCADASTRO" DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" />
            <telerik:GridBoundColumn DataField="PF_DESC" HeaderText="Perfil" SortExpression="PF_DESC" />
            <telerik:GridBoundColumn DataField="USU_ATIVO" HeaderText="Ativo?" SortExpression="USU_ATIVO" />
        </Columns>
        <NestedViewTemplate>
            <asp:Panel runat="server" ID="pnlDetalhes">
                <telerik:RadTabStrip runat="server" ID="radTabDetalhes" MultiPageID="radMultiDetalhes"
                    SelectedIndex="0">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Detalhes" PageViewID="pgDetalhes" />
                    </Tabs>
                </telerik:RadTabStrip>
                <telerik:RadMultiPage runat="server" ID="radMultiDetalhes" SelectedIndex="0" RenderSelectedPageOnly="false">
                    <telerik:RadPageView runat="server" ID="pgDetalhes" Width="500px">
                        <div>
                            <table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td valign="top">
                                        <div style="padding: 10px;">                                          
                                            <telerik:RadBinaryImage runat="server" ID="rbiAvatarSelecionado" DataValue='<%# Eval("USU_FOTO") == null ? null : (byte[])Eval("USU_FOTO") %>' AlternateText='<%# Eval("USU_NOME", "Avatar de {0}") %>' AutoAdjustImageControlSize="true" Visible='<%# Eval("USU_FOTO") == null ? false : true %>' />
                                        </div>
                                    </td>
                                    <td>
                                        <asp:DetailsView ID="dvUsuarioDetalhes" AllowPaging="false" GridLines="None" runat="server"
                                            Font-Italic="true" AutoGenerateRows="false" BorderStyle="None">
                                            <Fields>
                                                <asp:BoundField DataField="USU_CPF" HeaderText="CPF:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="EN_ENDERECO_DESC" HeaderText="Endereço:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="EN_BAIRRO" HeaderText="Bairro:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="EN_CIDADE" HeaderText="Cidade:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="UF_SIGLA" HeaderText="Estado:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="EN_CEP" HeaderText="Cep:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="CON_CEL" HeaderText="Celular:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="CON_TEL" HeaderText="Telefone:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="CON_MSN" HeaderText="MSN:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="CON_FACEBOOK" HeaderText="Facebook:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="CON_TWITTER" HeaderText="Twitter:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                                <asp:BoundField DataField="CON_SKYPE" HeaderText="Skype:" HeaderStyle-Font-Italic="false" HeaderStyle-Font-Bold="true" />
                                            </Fields>
                                        </asp:DetailsView>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
            </asp:Panel>
        </NestedViewTemplate>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="False" AllowColumnsReorder="False">
        <Resizing AllowColumnResize="False" />
    </ClientSettings>
    <GroupingSettings ShowUnGroupButton="False" />
</telerik:RadGrid>

In my control (<telerik:RadBinaryImage ID=rbiAvatarSelecionado /> in <NestedViewTemplate>) is not showing the image.
But doing a test with this control (<telerik:RadBinaryImage ID=rbiTeste  />) works fine!

DataTable dtUsuarioDetalhes = new DataTable();
dtUsuarioDetalhes = new UsuarioBLL().ListarDetalhes(1);
rbiTeste.DataValue = (byte[])dtUsuarioDetalhes.Rows[0]["USU_FOTO"];

Why i can't show the image in grid?

Thank you in advance!
Ahmad
Top achievements
Rank 1
 answered on 13 Aug 2016
4 answers
314 views
Hi,

I'm currently using RadControls for ASP.NET AJAX Q2 2009 NET35. I can make RadCalendar with GregorianCalendar and Arabic language working, but somehow the RadDatePicker is not showing when I use the same method.

Below is my code, very simple, only using 1 RadCalendar and 1 RadDatePicker and two buttons to switch between language. After switch to arabic, the RadDatePicker didn't work at all.

I need to use arabic month name and day name, but I want the calendar dates to be in Gregorian format, not hijri format. Do I need to change javascript code too? Or just the code-behind?

Default.aspx:
 
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
 
<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> 
    <div> 
    <asp:Button ID="Button1" runat="server" Text="en" onclick="Button1_Click" /> 
    <asp:Button ID="Button2" runat="server" Text="ar" onclick="Button2_Click" /> 
    <br /> 
    <telerik:RadCalendar ID="RadCalendar1" runat="server"
    </telerik:RadCalendar> 
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
    </telerik:RadDatePicker> 
    </div> 
    </form> 
</body> 
</html> 
 

Default.aspx.cs:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Globalization; 
 
public partial class _Default : System.Web.UI.Page  
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
    protected void Button1_Click(object sender, EventArgs e) 
    { 
        CultureInfo info = new CultureInfo("en-US"); 
        System.Threading.Thread.CurrentThread.CurrentCulture = info; 
        System.Threading.Thread.CurrentThread.CurrentUICulture = info; 
        GregorianCalendar calendar = new GregorianCalendar(); 
        info.DateTimeFormat.Calendar = calendar; 
        this.RadCalendar1.CultureInfo = info; 
        this.RadDatePicker1.Culture = info; 
        this.RadDatePicker1.Calendar.CultureInfo = info; 
    } 
    protected void Button2_Click(object sender, EventArgs e) 
    { 
        CultureInfo info = new CultureInfo("ar-SA"); 
        System.Threading.Thread.CurrentThread.CurrentCulture = info; 
        System.Threading.Thread.CurrentThread.CurrentUICulture = info; 
        GregorianCalendar calendar = new GregorianCalendar(); 
        info.DateTimeFormat.Calendar = calendar; 
        this.RadCalendar1.CultureInfo = info; 
        this.RadDatePicker1.Culture = info; 
        this.RadDatePicker1.Calendar.CultureInfo = info; 
    } 
 

Best regards,
Omar Suria
Ahmad
Top achievements
Rank 1
 answered on 13 Aug 2016
9 answers
746 views

Hello Telerik,

I was able to implement the Filter with MS DropdownList Instead of Textbox solution posted in the Telerik Help Site.

However, I am stumped as to why the dropdown filter works on some entries but not on some. See image below:

Below is how I declared my RadGrid in my .ASPX page:

<telerik:RadGrid ID="rgOT_Classifications"
                    runat="server"
                    Skin="Default"
                    GridLines="both"
                    BorderStyle="NotSet"
                    BorderColor="#336699"
                    BorderWidth="3"
                    PageSize="3"
                    Width="100%"
                    AllowPaging="true"
                    AllowFilteringByColumn="true"
                    AutoGenerateColumns="false"
                    AllowSorting="true"
                    ShowStatusBar="true"
                    AllowAutomaticDeletes="false"
                    AllowAutomaticInserts="false"
                    ItemStyle-BackColor="#f0f8ff"
                    AlternatingItemStyle-BackColor="White"
                    AllowAutomaticUpdates="false">
                    <PagerStyle Mode="NextPrevAndNumeric" />
                    <MasterTableView Width="100%" DataKeyNames="CLASSIFICATION" TableLayout="Auto" Caption="<strong><big>CLASSIFICATIONS</big></strong>"
                        CommandItemDisplay="Top" EditMode="EditForms" ExpandCollapseColumn-ButtonType="pushButton" AllowMultiColumnSorting="true"
                        Name="Classifications" ShowHeadersWhenNoRecords="true">
                        <CommandItemTemplate>
                            <table width="98%" style="margin:10px auto;">
                                <tr>
                                    <td align="left" style="vertical-align:middle;">
                                        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/add.png" CommandName="InitInsert" ImageAlign="Middle"/>
                                        <asp:LinkButton id="btnAddNewRecord" runat="server" CommandName="InitInsert" Font-Size="10" style="vertical-align:middle;"
                                                        ToolTip="Click to add a new Classification.">Add New Record
                                        </asp:LinkButton>
                                    </td>
                                    <td align="right">
                                        <div title="Click to clear the current filter criteria." style="float:left;">
                                            <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/clearfilter.gif" CommandName="ClearFilter" ImageAlign="Middle"/>
                                            <asp:LinkButton id="btnClearFilter"  Font-Size="10" style="vertical-align:middle;"
                                                            runat="server" CommandName="ClearFilter">Clear Filter
                                            </asp:LinkButton>
                                        </div>
                                        <div title="Click to reload data into the grid." style="float:right;">
                                            <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/images/Refresh.gif" CommandName="Refresh" ImageAlign="Middle"/>
                                            <asp:LinkButton style="vertical-align:middle;" id="btnRefresh"  Font-Size="10"
                                                            runat="server" CommandName="Refresh">Refresh
                                            </asp:LinkButton>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridEditCommandColumn UniqueName="Edit" ItemStyle-HorizontalAlign="center">
                            </telerik:GridEditCommandColumn> 
                            <telerik:GridBoundColumn DataField="CLASSIFICATION" HeaderText="Classification" UniqueName="CLASSIFICATION"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
                            </telerik:GridBoundColumn>
                            <custom:MyCustomFilteringColumn HeaderText="CLASS 1" DataField="CLASSIFICATION" UniqueName="CLASS1" AutoPostBackOnFilter="false" DataType="System.String" CurrentFilterFunction="Contains" >
                            </custom:MyCustomFilteringColumn>
                            <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" ItemStyle-HorizontalAlign="center">
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings UserControlName="~/maintenance/Edit_OT_Classifications.aspx"
                                          EditFormType="WebUserControl"
                                          PopUpSettings-Modal="true"
                                          PopUpSettings-Width="35%"
                                          >
                        </EditFormSettings>
                    </MasterTableView>
    </telerik:RadGrid>

It's odd that there is no pattern as to why some dropdown entries work and some don't. If you could create it on your end and let me know if it worked for you or not and if you have a solution for this.

Thanks,

Virgil

 

Virgil Rodriguez
Top achievements
Rank 1
 answered on 12 Aug 2016
4 answers
111 views

due to the lack of correct Persian calendar for telerik I'm trying to use a custom Jquery base datapicker

I have used the datapicker outside of grid and everything goes right

but the problem is that at grid's edit form when I click on datapicker box nothing shows

Maria Ilieva
Telerik team
 answered on 12 Aug 2016
1 answer
176 views

Hi Team,

I want to group the fields displayed in the filter with some header(like treeview)

For eg in the following link i want to group first name,home phone,country under the node Contact Details and i want to group the remaining columns similarly.

http://demos.telerik.com/aspnet-ajax/filter/examples/field-editors/defaultcs.aspx

Please help me to implement this.

Thanks in advance.

Regards,

Rajesh D

 

Eyup
Telerik team
 answered on 12 Aug 2016
8 answers
219 views
The web palette mode does not require the user to press an Apply button.  This is what I am looking for.  The HSV and HSB modes require the user to press the apply button.  Can I remove this functionality?  I see an idea where I can hide the apply button using CSS but then the color doesn't get returned by the selected color property. 
Pat
Top achievements
Rank 1
 answered on 12 Aug 2016
1 answer
142 views

When changing the recurrence dropdown from 'Yearly' or 'Monthly' to 'Never' kendo.all.js throws this error:

Uncaught TypeError: Cannot read property 'enable' of undefined

 

I can change from any other value to any other fine, just not to 'Never'

 

Thanks,

Dimitar
Telerik team
 answered on 12 Aug 2016
1 answer
269 views

Hi there,

Can anyone guide me on how to display custom text in RadScheduler AgendaView?

1 Change word "Agenda" on to "Custom Text"

2 Change Column header from "Appointment" to "Custom Text"

3 Change the word "appointment" in  "Are you sure you want to delete this appoinement" to "Custom Text"

Please help. Thank you.

 

 

 

Ivan Danchev
Telerik team
 answered on 12 Aug 2016
1 answer
73 views

Hi, I am trying to export the scheduler to pdf using the exportToPdf method, and on long schedules with paging enabled returns black images after the first page, where the schedule image should be. Does anyone know the cause and solution to this?

The code for when the export occurs looks like this:

            var schedulerPdfSettings = RadScheduler1.ExportSettings.Pdf;           
            schedulerPdfSettings.PageTitle = "some title";
            schedulerPdfSettings.PaperOrientation = ScheduleSessionManager.IsTimelineView ? SchedulerPaperOrientation.Landscape : SchedulerPaperOrientation.Portrait;
            schedulerPdfSettings.AllowPaging = true;
            RadScheduler1.ExportSettings.OpenInNewWindow = true;
            string[] styleSheets = { "../../Content/css/scheduleExport.css" };
            schedulerPdfSettings.StyleSheets = styleSheets;
            RadScheduler1.ExportToPdf();

Veselin Tsvetanov
Telerik team
 answered on 12 Aug 2016
1 answer
70 views

Hi

I have a working treelist on the page and need to add some functionality via buttons so when one is pressed some javascript attempts to find the treelist control using the standard $find(controlname) syntax.  This fails and just returns null.  I have double checked the clientID is correct and when using document.getElementById it returns the element part so I know that is OK.

Other than this the actual control with paging etc works just fine on the page.  

Any suggestions on what might cause this?

Regards

Jon

Jon
Top achievements
Rank 1
 answered on 12 Aug 2016
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?