Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
84 views

I originally build a 2 tier grid but then need to put a 3rd tier on it, I followed the example site for tiered grids for adding on but when I build and run the 3rd portion never show up even though I have information in the database to show.  What am i doing wrong here.

 <telerik:RadGrid ID="myGridDeploy" runat="server" Width="95%" BorderWidth="1px" CellPadding="6" GridLines="None" BorderColor="#404040" Skin="Web20">
                                    <MasterTableView AutoGenerateColumns="false" DataKeyNames="intMobilizationId" HierarchyDefaultExpanded="false" HierarchyLoadMode="ServerBind"
                                        BorderColor="#404040" Font-Size="12" Font-Names="Veranda,arial,sans-serif" HeaderStyle-HorizontalAlign="Center"
                                        GridLines="Both" BorderWidth="1px" ExpandCollapseColumn-ButtonType="ImageButton" ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png"
                                        ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png"><ItemStyle HorizontalAlign="Center" />
                                        <AlternatingItemStyle BackColor="#B0C4DE"  HorizontalAlign="Center" />
                                        <HeaderStyle ForeColor="White" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
                                        <Columns>
                                             <telerik:GridTemplateColumn HeaderText="Deployment" ItemStyle-HorizontalAlign="Left">
                                                <ItemTemplate>
                                                     <asp:LinkButton ID="lnkEdit" runat="server" CommandArgument='<%# bind("intMobilizationId") %>' CommandName="EditDeploy" text='<%# bind("strDeployment") %>'></asp:LinkButton>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn DataField="strHiearchy" HeaderText="UIC" />
                                            <telerik:GridBoundColumn DataField="dtDeploy" Headertext="DT_Deploy" />
                                            <telerik:GridBoundColumn DataField="dtDemob" HeaderText="DT_Demob" />
                                            <telerik:GridTemplateColumn HeaderText="Add Unit">
                                                <ItemTemplate>
                                                      <asp:ImageButton runat="server" ID="imgAdd"  CommandArgument='<%# bind("intMobilizationId") %>' CommandName="AddUnit" ImageUrl="~/Images/29.png" />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Delete">
                                                <ItemTemplate>
                                                      <asp:ImageButton runat="server" ID="imgDelete"  CommandArgument='<%# bind("intMobilizationId") %>' CommandName="DelDeploy" ImageUrl="~/Images/Delete Circle Small.png" OnClientClick="return confirm('Are you sure you want to delete deployment and all information!');" />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                             <telerik:GridTemplateColumn HeaderText="Archive">
                                                <ItemTemplate>
                                                      <asp:ImageButton runat="server" ID="imgArchive"  CommandArgument='<%# bind("intMobilizationId") %>' CommandName="Archive" ImageUrl="~/Images/edit_icon.png" OnClientClick="return confirm('Are you sure you want to archive deployment');" />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <DetailTables>
                                            <telerik:GridTableView Name="mySubUnits" runat="server" DataKeyNames="intUnitMobId" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10"
                                                AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                                ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                                <ParentTableRelation>
                                                    <telerik:GridRelationFields DetailKeyField="intMobilizationId" MasterKeyField="intMobilizationId" />
                                                </ParentTableRelation>
                                                <HeaderStyle Font-Bold="true" HorizontalAlign="Center" CssClass="MostInnerHeaderStyle" />
                                                <ItemStyle CssClass="MostInnerItemStyle" HorizontalAlign="Center" />
                                                <AlternatingItemStyle CssClass="MostInnerAlernatingItemStyle" HorizontalAlign="Center" />
                                                <DetailTables>
                                                    <telerik:GridTableView DataKeyNames="intPositionId" Name="mySubPosition" Width="100%">
                                                         <ParentTableRelation>
                                                            <telerik:GridRelationFields DetailKeyField="intUnitMobId" MasterKeyField="intUnitMobId" />
                                                         </ParentTableRelation>
                                                         <Columns>
                                                            <telerik:GridBoundColumn DataField="strPara" HeaderText="Para" />
                                                            <telerik:GridBoundColumn DataField="strLine" Headertext="Line" />
                                                            <telerik:GridBoundColumn DataField="intPositionNum" HeaderText="Position" />
                                                         </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                                <Columns>
                                                    <telerik:GridTemplateColumn HeaderText="Unit" ItemStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                             <asp:LinkButton ID="lnkEdit" runat="server" CommandArgument='<%# bind("intUnitMobId") %>' CommandName="EditUnit" text='<%# bind("strUIC") %>'></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridBoundColumn DataField="strAAUIC" HeaderText="BN Uic" />
                                                    <telerik:GridBoundColumn DataField="strMobOrderNum" HeaderText="Order Num" />
                                                    <telerik:GridBoundColumn DataField="dtDeploy" HeaderText="DT_Deploy" />
                                                    <telerik:GridBoundColumn DataField="dtProjDemob" HeaderText="DT_Demob" />
                                                    <telerik:GridTemplateColumn HeaderText="Add Position">
                                                        <ItemTemplate>
                                                              <asp:ImageButton runat="server" ID="imgAddPosition"  CommandArgument='<%# bind("intUnitMobId") %>' CommandName="AddPosition" ImageUrl="~/Images/29.png" />
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                     <telerik:GridTemplateColumn HeaderText="Del All Position">
                                                        <ItemTemplate>
                                                              <asp:ImageButton runat="server" ID="imgDelPosition"  CommandArgument='<%# bind("intUnitMobId") %>' CommandName="DelAllPosition" ImageUrl="~/Images/30.png"
                                                              OnClientClick="return confirm('Are you sure you want to delete all positions');"/>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                     <telerik:GridTemplateColumn HeaderText="Import Positions">
                                                        <ItemTemplate>
                                                              <asp:ImageButton runat="server" ID="imgImportPosition"  CommandArgument='<%# bind("intUnitMobId") %>' CommandName="AddMul" ImageUrl="~/Images/Import.png" />
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn HeaderText="Delete Unit">
                                                        <ItemTemplate>
                                                              <asp:ImageButton runat="server" ID="imgDelete"  CommandArgument='<%# bind("intUnitMobId") %>' CommandName="DelUnit" ImageUrl="~/Images/Delete Circle Small.png"
                                                              OnClientClick="return confirm('Are you sure you want to delete unit and all positions');" />
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                </Columns>
                                            </telerik:GridTableView>
                                        </DetailTables>
                                    </MasterTableView>
                                </telerik:RadGrid>


 Private Sub LoadGrid()
        Dim Id As String = ddlDeployments.SelectedValue
        Dim sqlwhere As String = ""

        If Id = "00" Then
            sqlwhere = ""
        Else
            sqlwhere = " and intMobilizationId = " & Id
        End If

        sql = "Select intMobilizationId, strDeployment, strHiearchy, Convert(varchar(10), dtDeploy, 111) dtDeploy, Convert(varchar(10), dtDemob, 111) dtDemob from tblMobDeployment " _
            & "where bitArchive is NULL " & sqlwhere & " Order by dtDeploy"
       
        myDataTable = New DataTable
        myDataTable = getData(sql)

        myGridDeploy.DataSource = myDataTable
        myGridDeploy.DataBind()

    End Sub

 'All code associated with the detail tables of the gridview
    Protected Sub myGridDeploy_DetailTableDataBind(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles myGridDeploy.DetailTableDataBind

        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
            Select e.DetailTableView.Name
            Case "mySubUnits"
                sql = "Select intUnitMobId, intMobilizationId, strMobOrderNum, strAAUic, strUIC, CONVERT(varchar(10), dtDeploy, 111) dtDeploy, CONVERT(varchar(10), dtProjDemob, 111) dtProjDemob from tblMobUnits " _
                    & "where bitArchive is NULL and intMobilizationId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intMobilizationId") & " Order by intMobilizationId"

                e.DetailTableView.DataSource = getData(sql)

            Case "mySubPosition"
                sql = "Select intPositionId, intUnitMobId, strPara, strLine, intPositionNum from tblMobUnitPosition " _
                   & "where intUnitMobId in (Select intUnitMobId from tblMobUnits where intMobilizationId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intMobilizationId") & ")"

                e.DetailTableView.DataSource = getData(sql)
        End Select
    End Sub

    Protected Sub myGridDeploy_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles myGridDeploy.Init
        myGridDeploy.MasterTableView.ExpandCollapseColumn.ItemStyle.CssClass = "expandCol"
    End Sub

    Protected Sub myGridDeploy_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles myGridDeploy.PreRender
        HideExpandColumnRecursive(myGridDeploy.MasterTableView)
    End Sub




Vasil
Telerik team
 answered on 19 Jul 2011
1 answer
132 views
We have already implemented a Notification. But I've realized, however, with a ToolTip. Is there a technical difference between the ToolTip and the new Notificaition Control
Is it worth to switching over?

Kind regards
CariNet
Svetlina Anati
Telerik team
 answered on 19 Jul 2011
1 answer
157 views
Hi Everyone

I'm new to this site and this is my first post. So please forgive me if this issue had alrady been posted.

I have a radtooltip inside a simple webpart (not a visual webpart) in a Sharepoint project. Because the webpart is not a visual one, I create a tooltip together with all the other components on the server side in the OnPreRender event.

There is a radajaxpanel surounding the webpart which in turn contains a div which in turn contains a table for every record I want to display in the webpart. Each table contains a radtooltip. There is also a radajaxloadingpanel that points to my webpart.

My webpart is connected to a calendar webpart on the page. When the user interacts with the calendar webpart and selectes a different date, I refresh my webpart  to display the data for that day. The problem is the radtooltip in my webpart stops working after the webpart is refreshed via ajax.

Also, when the page first loads or does a full refresh, sometimes the radtooltip works and sometimes it does not.

The bit of the code that creates the tooltip in the webpart is as follows:

RadToolTip tooltip = new RadToolTip();
tooltip.ID = "RadToolTip" + note.ID;
tooltip.TargetControlID = "divSubject" + note.ID;
tooltip.IsClientID = true;
tooltip.ShowEvent = ToolTipShowEvent.OnMouseOver;
tooltip.HideEvent = ToolTipHideEvent.LeaveToolTip;
tooltip.RelativeTo = ToolTipRelativeDisplay.Element;
tooltip.Skin = "Hay";
tooltip.Animation = ToolTipAnimation.None;
tooltip.ShowCallout = true;
tooltip.Title = note.Subject;
tooltip.CssClass = "diaryToolTip";
tooltip.EnableAjaxSkinRendering = true;
tooltip.RegisterWithScriptManager = true;
    
string line = @"<table border='0'>
<tr>
<td valign='top' align='left' width='60'>
<strong>Type: </strong>
</td>
<td align='left'>" + note.TypeName +
@"</td>
</tr>
</table>";

tooltip.Controls.Add(new LiteralControl(line));
phDiary.Controls.Add(tooltip);

 

 

("note" is a custom class and "phDiary" is the placeholder object that holds all components)

Any help is greatly appreciated.

Regards

Mohammad

 

Marin Bratanov
Telerik team
 answered on 19 Jul 2011
1 answer
94 views
How to open Tooltip inside Tool tip controli have a tooltip and inside toop tip there is text box control on text box click i want to open another tool tip.but when i clcik on textbox tooltip opens but main tooltip gets closed.
Svetlina Anati
Telerik team
 answered on 19 Jul 2011
3 answers
296 views

Hello ,
I am using custom radconfirm template. This is working fine. this is code. but I cann't change the text of lebel   "nodename".

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
 
        <ConfirmTemplate>
 
            <div class="confrmholder">
 
                <div style="width: 100%" align="center">
 
                    <asp:Label ID="Label1" CssClass="warningtext" runat="server" Text="Warning!"></asp:Label>
 
                </div>
 
                <div class="imgdiv">
 
                    <img src="worning.png" />
 
                </div>
 
                <div align="center">
 
                    <div align="center" style="width: 260px; float: left;">
 
                        <p>
 
                            Are you sure you want to delete the folder?
 
                        </p>
 
                        <p>
 
                        <asp:Label ID="nodename" CssClass="node" runat="server" Text="Node Name"></asp:Label>
 
                        </p>
 
                        <p>
 
                            This will delete all files.
 
                        </p>
 
                    </div>
 
                    <div align="center" style="padding-bottom: 8px; width:100%; float:left;">
 
                        <div>
 
                        <a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);">
 
                            <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[OK]##</span></span></a>
 
                        <a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);">
 
                            <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Cancel]##</span></span></a>
 
                        </div>
 
                    </div>
 
                </div>
 
            </div>
 
        </ConfirmTemplate>
 
    </telerik:RadWindowManager>

 

Now how can I change the name of tree node in the asp lable “nodename” dynamically?

Thanks
Nahid

Marin Bratanov
Telerik team
 answered on 19 Jul 2011
2 answers
212 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
627 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
26 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
295 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
221 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?