Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
213 views
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowPaging="True"
                        OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender" OnItemCommand="RadGrid1_ItemCommand"
                        OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ReportItemCreated">
                        <MasterTableView CommandItemDisplay="Top">
                            <Columns>
                                <telerik:GridTemplateColumn>
                                    <HeaderTemplate>
 
<tr class="subHeader" runat="server" id="headerTr">
<!-- I want to add html tags here from C# code behind -->
</tr>
                    </HeaderTemplate>
                                    <ItemTemplate>

Sample HTML that I want to add there is 
<th class="subHeader rgHeader">
                                                Test
                                            </th>
                                            <th class="subHeader rgHeader">
                                            </th>
                                            <th class="subHeader rgHeader">
                                                Test
                                            </th>

I also want to add HTML <ItemTemplate>
Sreedhar
Top achievements
Rank 1
 answered on 19 Jul 2011
8 answers
635 views

Hi,

Iam using a radcombo box to populate a list of ids and corresponding names (first name + last name).
How can I make Firstname bold ?

DataValueField

 

="Id"

 


DataTextField

 

="Name"

Your help is very much appreciated.

 

Kate
Telerik team
 answered on 19 Jul 2011
1 answer
28 views


I'm using the AsyncUpload control and I'm facing a big problem. Always I try to upload an Office file that is open, a JavaScript error is throwed. I searched at Telerik forum and found some similar problems, the Telerik team says this problem is being corrected.

http://www.telerik.com/community/forums/aspnet-ajax/async-upload/file-sharing-violation.aspx

Is there some update about this?

Peter Filipov
Telerik team
 answered on 19 Jul 2011
1 answer
306 views
Hi Forum.

I would like to know a way to stop a radajaxloadingpanel animation/loading with vb(if possible, if not c#?). My problem is the following: hen i hit a button a serie os validations are made, if validation returns false i want o show a tooltip showing some information, while doing the validation i want the radajaxloadingpanel to appear with animation/loading so the person can know that something is happening. From what i can understand, the problem here is that the end of the radajaloadingpanel animation/loading makes a postback of some sort witch makes the tooltip to hide. i tried 2 ways:


If Valido_Dados_Processos(novo_proceso) = True Then
    If MessageBox.Show("Tem a certeza que pretende criar um novo processo?", "Criação de processo", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
        If Existe_boletim_compProc(rmtb_procesocompanhia.TextWithLiterals, rmtb_apolice.TextWithLiterals, rcb_sinistrado.SelectedValue) Then
            Altera_Processo()
        Else
            Gravar_novo_Processo()
        End If
    End If
Else
    rtt_info_on_error.Visible = True
    rtt_info_on_error.Show()
End If


Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
    If valido_op_processo = False Then
        rtt_info_on_error.Visible = True
        rtt_info_on_error.Show()
        valido_op_processo = True
    End If
End Sub
Protected Sub rb_alterar_proceso_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rb_alterar_proceso.Click
    If Valido_Dados_Processos(grava_proceso) = True Then
        If MessageBox.Show("Tem a certeza que pretende alterar o processo?", "Alteração de dados", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
            If Existe_boletim_compProc(rmtb_procesocompanhia.TextWithLiterals, rmtb_apolice.TextWithLiterals, rcb_sinistrado.SelectedValue) And aux_boletimID <> "" Then
                Altera_Processo()
            Else
                Gravar_novo_Processo()
            End If
        End If
    Else
        valido_op_processo = False
    End If
End Sub

None of them worked, so if anyone could help me i would appreciate very much

Many thanks,
FEST
Radoslav
Telerik team
 answered on 19 Jul 2011
2 answers
228 views
Hello,

i want to display a button and the group header text at a GridGroupHeader cell. After some searching and trying I found some usefull code snippets but the behavior is not as expected. After the PostBack-Event the group header text disappears and only the button is shown.


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Grid.aspx.cs" Inherits="GridTest.ForecastGridTest" %>
 
<%@ 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">
 
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
            </telerik:RadStyleSheetManager>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            </telerik:RadScriptManager>
            <div>   
                <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
                                 AutoGenerateColumns="false" CellSpacing="0" GridLines="None"
                                 ShowGroupPanel="True" OnNeedDataSource="RadGrid1_OnNeedDataSource"
                                 OnItemDataBound="RadGrid1_OnItemDataBound"
                                 OnItemCreated="RadGrid1_OnItemCreated">
                    <ClientSettings AllowDragToGroup="True">
                    </ClientSettings>
                    <MasterTableView AutoGenerateColumns="False" GroupLoadMode="Server" GroupsDefaultExpanded="False">
                        <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <SelectFields><telerik:GridGroupByField FieldName="gl1" HeaderText="gl1" /></SelectFields>
                                <GroupByFields><telerik:GridGroupByField FieldName="gl1" SortOrder="Ascending" /></GroupByFields>
                            </telerik:GridGroupByExpression>
                            <telerik:GridGroupByExpression>
                                <SelectFields><telerik:GridGroupByField FieldName="gl2" HeaderText="gl2" /></SelectFields>
                                <GroupByFields><telerik:GridGroupByField FieldName="gl2" SortOrder="Ascending" /></GroupByFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>
 
                        <Columns>
                        <telerik:GridTemplateColumn HeaderStyle-Width="100px">                               
                                <ItemTemplate>
                                    <telerik:RadButton ID="RadButton1" runat="server" OnClick="OnClick" ButtonType="LinkButton" Text="plah" CommandName=""></telerik:RadButton>
                                    <telerik:RadButton ID="RadButton2" runat="server" OnClick="OnClick" ButtonType="LinkButton" Text="plah" ></telerik:RadButton>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn >
                                <telerik:GridButtonColumn HeaderText="Status" UniqueName="ImageColumn" ButtonType="ImageButton" HeaderStyle-Width="100px" />
                                <telerik:GridBoundColumn DataField="Forecast_Id" DataType="System.String" FilterControlAltText="Filter type1 column" HeaderText="ForecastId"  UniqueName="Forecast" />
                                <telerik:GridBoundColumn Display="False" DataField="Forecast_StdInt03" DataType="System.Int32" UniqueName="Status"  />
                        </Columns>
                     
 
                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
 
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
 
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
 
                    <FilterMenu EnableImageSprites="False"></FilterMenu>
 
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
                </telerik:RadGrid>   
            </div>
            <telerik:RadAjaxManager runat="server">
            </telerik:RadAjaxManager>
            <asp:ObjectDataSource runat="server" ID="osd1" TypeName="GridTest.DataAccess" SelectMethod="GetDataTable" >
            </asp:ObjectDataSource>
 
        </form>
    </body>
</html>

using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace GridTest
{
    public partial class ForecastGridTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RadGrid1.MasterTableView.HierarchyDefaultExpanded = false;
        }
 
 
        protected void RadGrid1_OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            var dataAccess = new DataAccess();
            var dataTable = dataAccess.GetDataTable();
            if (sender is RadGrid)
            {
                var grid = sender as RadGrid;
                grid.DataSource = dataTable;
            }
        }
 
        protected void OnClick(object sender, EventArgs e)
        {
            if (sender is RadButton)
            {
                var button = sender as RadButton;
                button.ForeColor = Color.Red;
 
            }
        }
 
        protected void RadGrid1_OnItemDataBound(object sender, GridItemEventArgs e)
        {
           _AppendButtonToHeader(e.Item);           
        }
 
        protected void RadGrid1_OnItemCreated(object sender, GridItemEventArgs e)
        {
           _AppendButtonToHeader(e.Item);
        }
 
 
        private void _AppendButtonToHeader(object item)
        {
            if (item is GridGroupHeaderItem)
            {
                var gridGroupHeaderItem = item as GridGroupHeaderItem;
                var dataCell = gridGroupHeaderItem.DataCell;
 
                var radButton = new RadButton();
                radButton.ButtonType = RadButtonType.StandardButton;
                radButton.Text = "do";
                radButton.Click += new EventHandler(radButton_Click);
 
                dataCell.Controls.Add(radButton);
                dataCell.Controls.Add(new LiteralControl(dataCell.Text));
            }
        }
 
        void radButton_Click(object sender, EventArgs e)
        {
            
        }       
    }
}

In a prior test i moved the logic to the PreRender event, but the event registration for the radButton does not work in this case. 
Can you please point me to the right direction.

thanks and greetings
Uwe
uwe
Top achievements
Rank 1
 answered on 19 Jul 2011
1 answer
94 views
Can you someone helps to show me how to disabled the grid if it's in the Detail Table of a Main Grid? I need to develop an App that required this feature. I know we need to use Grid Client API to work on it, but not sure how to write the javascript code. 

I've include the picture showed the Grid in Detail Table of the master Grid. If user click on the checkbox on the Master Grid, Grid in Detail Table should be ENABLED.

Thank you.
Princy
Top achievements
Rank 2
 answered on 19 Jul 2011
4 answers
177 views
Hi All,

 In my project i have one radtreeview and radgrid. when i check particular child node i am binding radgrid. These functionalities working fine. But i want to display radtreeview parent node and child node as a heading on radgrid.
I want to display heading like which is in Groupheadings.png screen shot in radgrid_with_radtreeview.png screen shot.

Please anybody help me.


Thanks,
Nagendra.
Nagendra
Top achievements
Rank 1
 answered on 19 Jul 2011
2 answers
188 views
Hello every one i want to show radlistview like msn.com view comments like
Any examples available in radlistview like that

http://www.msnbc.msn.com/id/43666041/?gt1=43001


In radlivtview i want to show only three record that view how i restrict that

Replay soon

Thanks,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 19 Jul 2011
2 answers
89 views
Hi,
I have a page consists of two grids. The bigger one is located in the center of screen, the other is smaller one which is placed at the rigth top corner. I have a template column including a button in bigger and centered grid. When it clicked some ajax code is executed. If I define
ajax setting as follows both of the grids are refreshing. But I only need smaller one to be refreshed.  If I remove the the bigger one's config item from UpdatedControls  section "Loading" sign is seems in the center of smaller grid. But I want the sign to be in the center og bigger grid. How can I do it? Refreshing two grids causes performance problem even there is no need.
Thank you,

<telerik:RadAjaxManager ID="ram" runat="server" OnAjaxRequest="ram_AjaxRequest">
....
<telerik:AjaxSetting AjaxControlID="bigger...">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="smaller..." LoadingPanelID="rLoadPanelMain" />
                    <telerik:AjaxUpdatedControl ControlID="bigger..." LoadingPanelID="rLoadPanelMain" />
                </UpdatedControls>
</telerik:AjaxSetting>    
....

<telerik:RadAjaxLoadingPanel ID="rLoadPanelMain" runat="server" Skin="Mar" EnableEmbeddedSkins="false" ></telerik:RadAjaxLoadingPanel>
Nazim
Top achievements
Rank 1
 answered on 19 Jul 2011
1 answer
189 views

Under the RadListView you suggest the following:


RadControls for ASP.NET AJAX

Collapse imageAccessing controls in the LayoutTemplate

To get reference to a control in RadListView LayoutTemplate you can use its FindControl(controlId) method.

CopyC#
protected void RadListView1_PreRender(object sender, EventArgs e)
{
    Label lbl = RadListView1.FindControl("Label1") as Label;
}

I can't make it work. 
My code:
<telerik:RadListView ID="RadListView1" runat="server" AllowPaging="True"
    ItemPlaceholderID="PlaceHolder1" onitemcreated="RadListView1_ItemCreated"
    onprerender="RadListView1_PreRender" >
    <LayoutTemplate>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    </LayoutTemplate>
    <ItemTemplate>
        <div style="float: left;">
            <fieldset style="border: 0; width: 154px; height: 154px; margin: 5px 5px 5px 5px;">
                <div class="myClass" style="padding: 2px 2px 2px 2px; background: #eeeeee; text-align: center;">
                    <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AutoAdjustImageControlSize="False"
                        CssClass="myClass" ImageUrl='<%# Eval("thumbUrl") %>' ResizeMode="Fit" AlternateText="Click to view preview"
                        ToolTip="Click to view preview" Width="150px" Height="150px" />
                </div>
            </fieldset>
            <div style="border: 0px; white-space: normal; width: 150px; margin: 5px 5px 5px 5px;
                padding: 2px 2px 2px 2px;">
                <asp:CheckBox ID="chkImage" runat="server" AutoPostBack="True" />
                <asp:HyperLink ID="lnkAsset" Target="_blank" NavigateUrl='javascript:void(0);' runat="server"><%# Eval("filename") %></asp:HyperLink>
                <asp:HiddenField ID="hiddenAssetId" Value='<%# Eval("id") %>' runat="server" />
            </div>
        </div>
    </ItemTemplate>
    <EmptyDataTemplate>
        No Assets Found
    </EmptyDataTemplate>
</telerik:RadListView>
Code behind:
protected void RadListView1_PreRender (object sender, EventArgs e)
{
    HyperLink lnkAsset = RadListView1.FindControl ("lnkAsset") as HyperLink;
    lnkAsset.Attributes.Add ("OnClick", "javascript:void(assetInfoPopUp(assetId));return false;");
}
lnkAsset is null.
Shinu
Top achievements
Rank 2
 answered on 19 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?