Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
84 views
I create a rad combo as part of a composit control and it populates normally however when I try to assign eventhandlers client side, it appears the client side events are never raised. I can see the before and after event handlers in the debugger (see below) and they do get assigned. But, when I click on the radCombo and select an item neither of these event handlers executes. What am I missing or what more can I test to find the issue? Thanks!

// the control definition
MyControlNS.MyControl = function(element) {
    MyControlNS.MyControl.initializeBase(this, [element]);
    Sys.Application.add_load(Function.createDelegate(this, MyControlNS.MyControl.onLoaded));
}

// the onLoaded handler
MyControlNS.MyControl.onLoaded = function() {
    debugger;
    $find(this._myControlRadComboClientID).OnClientSelectedIndexChanged = this._tempItemChanged;
    $find(this._myControlRadComboClientID).OnClientDropDownOpening = function() { alert("hello world"); };
}

Keith Thorne
Top achievements
Rank 1
 answered on 01 Apr 2010
1 answer
388 views
Hi,

Not sure if this question is best suited for the Filter or the RadGrid, but I was wondering if there is a way to customize the filter dropdowns. I notice that the dropdown looks a bit like a lot of the popdown menus which show an icon to the left of the text. Is it possible to change these to add in icons similar to what is shown in my attached graphic?

Likewise, is it possible to change the 'T' image itself on the button that drops down the filter list?

I looked at the Style Builder tool but I didn't see anything in there for this..

Thanks in advance!
Iana Tsolova
Telerik team
 answered on 01 Apr 2010
2 answers
83 views
Hi

I am struggling to find the correct syntax to set the selected item of a grid...

I can do it to a list easily enough (lstDtTo.SelectedIndex = 0)

But not on the grid... Can anyone point me in the right direction..?

Thanks..!

Luke
Rudie Chiu
Top achievements
Rank 1
 answered on 01 Apr 2010
3 answers
155 views
Now, understand that I know that when you create a recurring event only the master and any exceptions are stored on the DB.

Now, what I need is to create a treeview of a segment of a scheduler time frame with a node for each event. For regular events that's a piece of cake. What I need to is to be able to create 'dummy' entries to represent the events that Scheduler creates on the fly for recurring events.

So, the question is, given, say, a DB event record, complete with a recurrence rule, is their any way of creating a list of some sort of the events that Scheduler would create? Even if all I got back was a list of start and end datetimes I could prolly work the rest from there.

Even as I type this I'm pretty sure of the answer, but, ever the optimist, I will ask anyway! :-)

Go on, make my day!

--
Stuart
Peter
Telerik team
 answered on 01 Apr 2010
2 answers
102 views
Hello,

I have a ListView  in which I have an EditItemTemplate.  Within that template I have two Combo Boxes that are populated via an ObjectDataSource.  Upon entering edit mode, the fill on the ODS runs twice.  Any way to prevent this from happening?

NY Norton
Top achievements
Rank 1
 answered on 01 Apr 2010
4 answers
118 views
Hi,
My splitter consists of two panes: left and right. The left one contains a RadSlidingZone->RadSlidingPane->RadPanelBar acting as a navigator and the right one shows the content according to the navigator.
When:
- the navigator is undocked
- the content contains an open pdf file (to be precise: contains a form (.aspx) containing an iframe containing this pdf)
hovering over the navigator slides it out - but under the pdf. The same is when I open, for example, an MS Word document.

It is also in the cases of Chrome and Safari. In the case of Firefox: the navigator also slides under the pdf but after a while jumps to the front: except the RadSlidingPane's title which remains under the pdf.

Can I do anything to make the navigator sliding over the open document?

Regards
Tomasz
Tsvetie
Telerik team
 answered on 01 Apr 2010
3 answers
190 views

Hi, I have an ajax panel wrapping the whole content of a content page (I use masterpages) and the problem is that I have some panels that are set to visibile="false" when the page is loaded and then made visible based on the value of a combo box select change. If I tab to these newly visible controls and enter a value it is like the value isn't really in there, because when I tab back or if I post-back then the values are cleared out. What can I be doing wrong? Thanks in advance.

 

<

 

asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

 

 

 

<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">

 

 

 

</asp:ScriptManagerProxy>

 

 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="100%">
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" />
etc......................

 

 

 

 


Iana Tsolova
Telerik team
 answered on 01 Apr 2010
1 answer
111 views
i tried to open radwindow from formview edit view with 2 parameters with the window declared inside or outside the formview control, no luck either way. always got same javascript error object expected. please help~
Princy
Top achievements
Rank 2
 answered on 01 Apr 2010
1 answer
111 views
Hi

this is shanker am doing project .I am using 3 level of hierarchy rad grid .My requirement is parent of parent cloumn in child grid 
I want 1 level grid cloumn in 3 level grd.

 if (e.Item.OwnerTableView.Name == "Check_payable")
                        {
                            GridDataItem editedItem1 = e.Item.OwnerTableView.ParentItem as GridDataItem;
                            CheckBox chk = editedItem1["locked"].Controls[0] as CheckBox;
                            if (chk != null)
                            {
                                if (chk.Checked == false)
                                {

                            int? faciltyid = LogonDetails.Instance.sys_lclvar_default_facility_id;
                            GridEditableItem editedItem = e.Item as GridEditableItem;
                            Dictionary<string, object> values = checkEditValues(editedItem);
                            try
                            {

                                int? fee_transaction_id = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["fee_transaction_id"].ToString().GetInteger();
                                LogonDetails det = LogonDetails.Instance;
                                string status_text = String.Empty;
                                byte demand_draft_flag = 1;
                                bool res = feetranscationmanager.sch_sproc_dml_sch_fee_transaction_dd_check_ins(fee_transaction_id, values["bank_branch"] as string, values["bank_name"] as string, values["dd_check_number"] as string, Convert.ToByte(values["favour_of_id"]) as byte?,
                                values["check_date"] as DateTime?, values["check_expiry_date"] as DateTime?, demand_draft_flag, values["Discription"] as string, out status_text);
                                if (res)
                                {
                                    DisplayMessage(false, "Record inserted");
                                }
                                else
                                {

                                    DisplayMessage(true, "Can't insert Record. Reason: " + status_text);
                                }
                            }
                            catch (Exception ex)
                            {

                                DisplayMessage(true, "Record cannot be inserted. Reason: " + ex.Message);
                            }
                        }
                                else
                                {

                                    DisplayMessage(true, "Receipt Locked");
                                }
                    }

 GridDataItem editedItem1 = e.Item.OwnerTableView.ParentItem as GridDataItem;
                            CheckBox chk = editedItem1["locked"].Controls[0] as CheckBox;
                            if (chk != null)
                            {
                                if (chk.Checked == false)
                                {
i want this check box
 this check box column in main grid means parent grid Please it's very argent 

how to solve that please give me solutions 
thanks and regards 
shanker.B
Princy
Top achievements
Rank 2
 answered on 01 Apr 2010
1 answer
263 views
Hello,

I'm trying to do the RadGrid as is, in the example the following link: http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx,
and parts of binding within RadPageView are not getting visible, even while they datasources
met, could give me a help to resolve this issue, because the contents are not displayed in RadPageView. The following are the codes. Aspx and cs.


ASPX:

<%@ Page Title="" Language="C#" MasterPageFile="~/Protegidos/Administracao/GENTE_Adm.master"
    AutoEventWireup="true" CodeFile="LogOperacao.aspx.cs" Inherits="Protegidos_Log_LogOperacao" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphSubConteudo" runat="Server">
    <style type="text/css">
        .viewWrap
        {
            padding: 15px;
            background: #2291b5 0 0 url(Img/bluegradient.gif) repeat-x;
        }
        .contactWrap
        {
            padding: 10px 15px 15px 15px;
            background: #fff;
            color: #333;
        }
        .contactWrap td
        {
            padding: 0 20px 0 0;
        }
        .contactWrap td td
        {
            padding: 3px 20px 3px 0;
        }
        .contactWrap img
        {
            border: 1px solid #05679d;
        }
    </style>
    <!-- content start -->
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgLogdado">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgLogdado" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <table width="99%" align="center">
        <tr>
            <td colspan="2">
                <div class="Titulo01">
                    Administração</div>
                <div class="Titulo02">
                    Log</div>
            </td>
        </tr>
        <tr>
            <td>
                <table width="100%" align="right">
                    <tr id="trMensagem" runat="server" visible="false">
                        <td valign="middle" style="background-color: #FFFFAA; height: 25px; width: 100%">
                            &nbsp;&nbsp;
                            <asp:Label ID="lblResultado" runat="server" Text="" Font-Names="Verdana" Font-Size="9"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="subTitulo_pagina">
                                Dados Log</div>
                            <div class="espaco">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table class="textoCZ_12B" width="99%">
                                <tr>
                                    <td style="width: 146px">
                                        Código do Prestador
                                    </td>
                                    <td style="width: 180px">
                                        <telerik:RadComboBox ID="rcbPrestador" runat="server">
                                        </telerik:RadComboBox>
                                        <asp:RequiredFieldValidator ID="rfvPrestador" runat="server" ControlToValidate="rcbPrestador"
                                            ErrorMessage="*" InitialValue="-- Selecione --" Text="*" ValidationGroup="vgLog"></asp:RequiredFieldValidator>
                                    </td>
                                    &nbsp&nbsp
                                    <td style="width: 81px">
                                        Usuário
                                    </td>
                                    <td style="width: 180px">
                                        <telerik:RadComboBox ID="rcbUsuario" runat="server">
                                        </telerik:RadComboBox>
                                        <asp:RequiredFieldValidator ID="rfvUsuario" runat="server" ControlToValidate="rcbUsuario"
                                            ErrorMessage="*" InitialValue="-- Selecione --" Text="*" ValidationGroup="vgLog"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 146px">
                                        Data Inicial
                                    </td>
                                    &nbsp&nbsp
                                    <td style="width: 117px">
                                        <telerik:RadDatePicker ID="rdpDataAcaoInicio" runat="server" ShowPopupOnFocus="true"
                                            MinDate="01/01/1850" MaxDate="01/01/3000">
                                            <DateInput DateFormat="dd/MM/yyyy" EmptyMessage="dd/MM/aaaa">
                                            </DateInput>
                                        </telerik:RadDatePicker>
                                        <asp:RequiredFieldValidator ID="rfvDataAcao" runat="server" ControlToValidate="rdpDataAcaoInicio"
                                            ErrorMessage="*" Text="*" ValidationGroup="vgLog"></asp:RequiredFieldValidator>
                                    </td>
                                    <td style="width: 81px">
                                        Data Inicial
                                    </td>
                                    &nbsp&nbsp
                                    <td>
                                        <telerik:RadDatePicker ID="rdpDataAcaoFinal" runat="server" ShowPopupOnFocus="true"
                                            MinDate="01/01/1850" MaxDate="01/01/3000">
                                            <DateInput DateFormat="dd/MM/yyyy" EmptyMessage="dd/MM/aaaa">
                                            </DateInput>
                                        </telerik:RadDatePicker>
                                        <asp:RequiredFieldValidator ID="rfvDataAcaoFinal" runat="server" ControlToValidate="rdpDataAcaoFinal"
                                            ErrorMessage="*" Text="*" ValidationGroup="vgLog"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 146px">
                                        Tipo da Ação
                                    </td>
                                    <td colspan="3">
                                        <telerik:RadComboBox ID="rcbTipoAcao" runat="server">
                                        </telerik:RadComboBox>
                                        <asp:RequiredFieldValidator ID="rfvTipoAcao" runat="server" ControlToValidate="rcbTipoAcao"
                                            ErrorMessage="*" InitialValue="-- Selecione --" Text="*" ValidationGroup="vgLog"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6" align="right">
                                        <asp:Button ID="brnPesquisar" Text="Pesquisar" runat="server" OnClick="brnPesquisar_Click" />
                                        <asp:HiddenField ID="hdnTipoDado" runat="server" />
                                        <asp:HiddenField ID="hdnIdLog" runat="server" />
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="6">
                                        <telerik:RadGrid ID="rgLogdado" runat="server" AllowPaging="True" Width="100%" Skin="Telerik"
                                            OnPreRender="rgLogdado_PreRender" OnItemCreated="rgLogdado_ItemCreated" OnItemCommand="rgLogdado_ItemCommand"
                                            AllowAutomaticInserts="false" ShowGroupPanel="true">
                                            <PagerStyle Mode="NumericPages" />
                                            <MasterTableView Width="100%" CommandItemDisplay="Top" PageSize="10" AutoGenerateColumns="false"
                                                DataKeyNames="IdLog">
                                                <Columns>
                                                    <telerik:GridBoundColumn UniqueName="IdLog" HeaderText="IdLog" DataField="IdLog"
                                                        Visible="false">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn UniqueName="RazaSocialPatrocinador" HeaderText="Patrocinador"
                                                        DataField="RazaSocialPatrocinador" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn UniqueName="RazaoSocialPrestador" HeaderText="Prestador"
                                                        DataField="RazaoSocialPrestador" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn UniqueName="Login" HeaderText="Usuário" DataField="Login"
                                                        ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="150px">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn UniqueName="TipoAcao" HeaderText="Ação" DataField="TipoAcao"
                                                        ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="100px">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn UniqueName="DataAcao" HeaderText="Data" DataField="DataAcao"
                                                        ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="100px">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                                <NestedViewTemplate>
                                                    <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap">
                                                        <div class="contactWrap">
                                                            <fieldset style="padding: 10px;">
                                                                <legend style="padding: 5px;"><b>Log de Operações</b> </legend>
                                                                <table>
                                                                    <tr>
                                                                        <td>
                                                                            <telerik:RadTabStrip runat="server" ID="TabLog" MultiPageID="Multipage1" SelectedIndex="0">
                                                                                <Tabs>
                                                                                    <telerik:RadTab runat="server" Text="Dados Anteriores" PageViewID="PageView1">
                                                                                    </telerik:RadTab>
                                                                                    <telerik:RadTab runat="server" Text="Dados Atuais" PageViewID="PageView2">
                                                                                    </telerik:RadTab>
                                                                                    <telerik:RadTab runat="server" Text="Detalhes do Log" PageViewID="PageView3">
                                                                                    </telerik:RadTab>
                                                                                </Tabs>
                                                                            </telerik:RadTabStrip>
                                                                            <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                                                                                <telerik:RadPageView runat="server" ID="PageViewDadosAnteriores">
                                                                                    <telerik:RadGrid runat="server" ID="rgAnterior" OnNeedDataSource="rgAnterior_NeedDataSource"
                                                                                        ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false">
                                                                                        <MasterTableView ShowHeader="true" AutoGenerateColumns="true">
                                                                                        </MasterTableView>
                                                                                    </telerik:RadGrid>
                                                                                </telerik:RadPageView>
                                                                                <telerik:RadPageView ID="PageViewDadosAtuais" runat="server">
                                                                                    <telerik:RadGrid runat="server" ID="rgAtual" ShowFooter="true" AllowSorting="true"
                                                                                        EnableLinqExpressions="false" OnNeedDataSource="rgAtual_NeedDataSource">
                                                                                        <MasterTableView ShowHeader="true" AutoGenerateColumns="true">
                                                                                        </MasterTableView>
                                                                                    </telerik:RadGrid>
                                                                                </telerik:RadPageView>
                                                                                <telerik:RadPageView runat="server" ID="PageViewDetalhes">
                                                                                </telerik:RadPageView>
                                                                            </telerik:RadMultiPage>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </fieldset>
                                                        </div>
                                                    </asp:Panel>
                                                </NestedViewTemplate>
                                            </MasterTableView>
                                        </telerik:RadGrid>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>


CS:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SMA.Log;
using SMA.Seguranca.DadosV2;
using SMA.GENTEv1;
using System.Data;
using System.Xml;
using System.IO;
using System.Text;
using System.Xml.Linq;
using SMA.Core;
using Telerik.Web.UI;

public partial class Protegidos_Log_LogOperacao : PageBase
{
    private LogOPeration logOperation;
    private List<LogOPeration> listLogOperation;
    private SMA.Seguranca.Usuario usuario;
    private Organizacao organizacao;

    private DataSet dsDadoAnterior;
    private DataTable dtDadoAnterior;

    private DataSet dsDadoAtual;
    private DataTable dtDadoAtual;

    private XElement xElementParse;
    private SMAXmlBuilder smaXmlBuilder;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            CarregarPrestador();
            CarregarUsuario();
            CarregarTipoAcao();
        }
    }

    private void CarregarTipoAcao()
    {
        SMA.Log.TipoAcao tipoAcao = new SMA.Log.TipoAcao();
        Util.BindDropDownlist(tipoAcao.SelectAll(), "descricao", "IdTipoAcao", true, ref rcbTipoAcao);
    }

    private void CarregarPrestador()
    {
        organizacao = new Organizacao();
        organizacao.IdOrganizacao = IdPatrocinador;
        Util.BindDropDownlist(organizacao.SelectPatrocinadorPrestador(), "RazaoSocial", "IdOrganizacao", true, ref this.rcbPrestador);
    }

    private void CarregarUsuario()
    {
        usuario = new SMA.Seguranca.Usuario();
        Util.BindDropDownlist(usuario.SelectAll(), "Login", "IdUsuario", true, ref this.rcbUsuario);
    }

    protected void brnPesquisar_Click(object sender, EventArgs e)
    {
        Page.Validate("vgLog");
        if (Page.IsValid)
        {
            SelecionarLog();
        }
    }

    private void SelecionarLog()
    {
        DateTime? dataOPeracao;

        logOperation = new LogOPeration();

        logOperation.IdPrestador = Convert.ToInt32(this.rcbPrestador.SelectedValue);
        logOperation.IdUsuario = Convert.ToInt32(this.rcbUsuario.SelectedValue);
        logOperation.IdTipoAcao = Convert.ToInt32(this.rcbTipoAcao.SelectedValue);

        dataOPeracao = this.rdpDataAcaoInicio.SelectedDate;
        logOperation.DataAcaoInicio = dataOPeracao.Value;

        dataOPeracao = this.rdpDataAcaoFinal.SelectedDate;
        logOperation.DataAcaoFinal = dataOPeracao.Value;

        listLogOperation = logOperation.SelectLog();
        logOperation.Dispose();

        rgLogdado.DataSource = listLogOperation;
        rgLogdado.DataBind();
    }

    protected void rgLogdado_PreRender(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.rgLogdado.MasterTableView.Rebind();
        }

        foreach (GridCommandItem cmditm in rgLogdado.MasterTableView.GetItems(GridItemType.CommandItem))
        {
            if (rgLogdado.Items.Count > 0)
            {
                Button btn1 = (Button)cmditm.FindControl("AddNewRecordButton");
                btn1.Visible = false;
                LinkButton lnkbtn1 = (LinkButton)cmditm.FindControl("InitInsertButton");
                lnkbtn1.Visible = false;
            }
        }
    }

    /// <summary>
    /// Pegar dados xml do log
    /// </summary>
    /// <param name="idLog">Código do log</param>
    /// <param name="tipoDado">Tipo de Dado -> 1= Dado Atual, 2 -> Dado Anterior</param>
    /// <returns>Dataset contendo os dados do xml</returns>
    private DataSet GetDataTableFromXml(int idLog, int tipoDado)
    {
        List<LogOPeration> listLogSelected;
        DataSet returnData = null;

        logOperation = new LogOPeration();
        logOperation.IdLog = idLog;
        listLogSelected = logOperation.SelectLogById();

        if (listLogSelected != null)
        {
            if (listLogSelected.Count > 0)
            {
                switch (tipoDado)
                {
                    case 1:
                        {
                            if (!string.IsNullOrEmpty(listLogSelected[0].DadoAtual))
                            {
                                dsDadoAtual = new DataSet();
                                dtDadoAtual = new DataTable();

                                xElementParse = XElement.Parse(listLogSelected[0].DadoAtual, LoadOptions.None);

                                smaXmlBuilder = new SMAXmlBuilder();
                                dtDadoAtual = smaXmlBuilder.XElementToDataTable(xElementParse);

                                dsDadoAtual.Tables.Add(dtDadoAtual);
                            }
                            else
                                dsDadoAtual = new DataSet();

                            returnData = dsDadoAtual;
                        }
                        break;
                    case 2:
                        {
                            if (!string.IsNullOrEmpty(listLogSelected[0].DadoAnterior))
                            {
                                dsDadoAnterior = new DataSet();
                                dtDadoAnterior = new DataTable();

                                xElementParse = XElement.Parse(listLogSelected[0].DadoAnterior, LoadOptions.None);

                                smaXmlBuilder = new SMAXmlBuilder();
                                dtDadoAnterior = smaXmlBuilder.XElementToDataTable(xElementParse);

                                dsDadoAnterior.Tables.Add(dtDadoAnterior);
                            }
                            else
                                dsDadoAnterior = new DataSet();

                            returnData = dsDadoAnterior;
                        }
                        break;
                }
            }
        }

        return returnData;
    }

    protected void rgLogdado_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridNestedViewItem)
        {
            //e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
        }
    }

    protected void rgLogdado_ItemCommand(object source, GridCommandEventArgs e)
    {
        DataSet dsBind = null;

        if (e.CommandName == RadGrid.ExpandCollapseCommandName)
        {
            this.hdnIdLog.Value = ((GridDataItem)e.Item).Cells[2].Text;

            Panel panelItems = (Panel)((GridDataItem)e.Item).ChildItem.FindControl("NestedViewPanel");
            if (panelItems != null)
            {
                panelItems.Visible = true;
                //!e.Item.Expanded;
            }
            //((GridDataItem)e.Item).ChildItem.FindControl("NestedViewPanel").Visible = true;
            //!e.Item.Expanded;
            //Preencher grid de dados anteriores
            RadGrid rgDadoAnterior = (RadGrid)((GridDataItem)e.Item).ChildItem.FindControl("NestedViewPanel").FindControl("rgAnterior");
            if (rgDadoAnterior != null)
            {
                if (!string.IsNullOrEmpty(((GridDataItem)e.Item).Cells[2].Text))
                {
                    dsBind = GetDataTableFromXml(Convert.ToInt32(((GridDataItem)e.Item).Cells[2].Text), 2);
                    if (dsBind != null)
                    {
                        if (dsBind.Tables.Count > 0)
                        {
                            rgDadoAnterior.MasterTableView.DataSource = dsBind;
                            rgDadoAnterior.DataBind();
                        }
                    }
                }
            }

            //Prencher dados atuais
            RadGrid rgDadoAtual = (RadGrid)((GridDataItem)e.Item).ChildItem.FindControl("NestedViewPanel").FindControl("rgAtual");
            if (rgDadoAtual != null)
            {
                if (!string.IsNullOrEmpty(((GridDataItem)e.Item).Cells[2].Text))
                {
                    dsBind = GetDataTableFromXml(Convert.ToInt32(((GridDataItem)e.Item).Cells[2].Text), 1);
                    if (dsBind != null)
                    {
                        if (dsBind.Tables.Count > 0)
                        {
                            rgDadoAtual.MasterTableView.DataSource = dsBind;
                            rgDadoAtual.DataBind();
                        }
                    }
                }
            }
        }
    }

    protected void rgAnterior_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        RadGrid rgLogAnterior = null;

        if (!e.IsFromDetailTable)
        {
            if (!string.IsNullOrEmpty(this.hdnIdLog.Value))
            {
                rgLogAnterior = (RadGrid)this.rgLogdado.FindControl("NestedViewPanel").FindControl("rgAnterior");
                if (rgLogAnterior != null)
                {
                    rgLogAnterior.DataBind();
                }
            }
        }
    }

    protected void rgAtual_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        RadGrid rgLogAtual = null;

        if (!e.IsFromDetailTable)
        {
            if (!string.IsNullOrEmpty(this.hdnIdLog.Value))
            {
                rgLogAtual = (RadGrid)this.rgLogdado.FindControl("NestedViewPanel").FindControl("rgAtual");
                if (rgLogAtual != null)
                {
                    rgLogAtual.DataBind();
                }
            }
        }
    }
}

Thanks,

Ivan Souza.











Mira
Telerik team
 answered on 01 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?