Create server controls containing DataGrid

Discussion in 'ASP .Net Web Controls' started by J Gopinath, May 25, 2004.

  1. J Gopinath

    J Gopinath Guest

    Hi,
    How to create server control which is containing DataGrid?. And how to
    implement the server control in .ascx file and in runtime how to display the
    records from Dataset?.

    Regards
    -Gopi

    Disclaimer Information contained in this E-MAIL being proprietary to Scape
    Velocity, Inc is 'privileged', 'confidential' and intended for use only by
    the individual or entity to which it is addressed. Any use or dissemination
    of any information contained in the E-MAIL beyond that necessary to conduct
    business with Scape Velocity, Inc. is strictly prohibited, except as may be
    agreed to in writing between Scape Velocity and you or your organization. If
    the reader of this message is not the intended recipient or agent
    responsible for delivering this message to the intended recipient, you are
    hereby notified that any dissemination, distribution, or copying of this
    communication is prohibited. If you have received this communication in
    error, please notify us immediately and delete this email. Scape Velocity,
    Inc ------------------------------------------------------------------------
    -- Global Software Development at the speed of 'e'
     
    J Gopinath, May 25, 2004
    #1
    1. Advertising

  2. public class TableDataView: WebControl

    {

    protected DataGrid innerGrid;

    public TableDataView()

    {

    innerGrid = new DataGridEx();

    Controls.Add(innerGrid);

    innerGrid.AutoGenerateColumns = true;

    innerGrid.AllowSorting = true;

    innerGrid.EnableViewState = true;

    innerGrid.CellSpacing=1;



    innerGrid.GridLines = GridLines.None;

    innerGrid.ItemDataBound += new
    DataGridItemEventHandler(innerGrid_ItemDataBound);

    innerGrid.SortCommand += new
    DataGridSortCommandEventHandler(innerGrid_SortCommand);

    innerGrid.PageIndexChanged += new
    DataGridPageChangedEventHandler(innerGrid_PageIndexChanged);


    IReport m_Report;



    public IReport Report

    {

    get

    {

    return m_Report;

    }

    set

    {

    m_Report = value;

    }

    }

    public override void DataBind()

    {

    //RebuildColumns();

    innerGrid.DataSource = Report.ReportData;

    innerGrid.DataMember = "Data";

    innerGrid.DataBind();

    }



    protected override void RenderContents(System.Web.UI.HtmlTextWriter
    p_Writer)

    {

    EnsureChildControls();

    innerGrid.CssClass=this.CssClass;

    RenderChildren(p_Writer);

    }

    }

    }




    "J Gopinath" <> wrote in message
    news:...
    > Hi,
    > How to create server control which is containing DataGrid?. And how to
    > implement the server control in .ascx file and in runtime how to display

    the
    > records from Dataset?.
    >
    > Regards
    > -Gopi
    >
    > Disclaimer Information contained in this E-MAIL being proprietary to Scape
    > Velocity, Inc is 'privileged', 'confidential' and intended for use only by
    > the individual or entity to which it is addressed. Any use or

    dissemination
    > of any information contained in the E-MAIL beyond that necessary to

    conduct
    > business with Scape Velocity, Inc. is strictly prohibited, except as may

    be
    > agreed to in writing between Scape Velocity and you or your organization.

    If
    > the reader of this message is not the intended recipient or agent
    > responsible for delivering this message to the intended recipient, you are
    > hereby notified that any dissemination, distribution, or copying of this
    > communication is prohibited. If you have received this communication in
    > error, please notify us immediately and delete this email. Scape Velocity,
    >

    Inc ------------------------------------------------------------------------
    > -- Global Software Development at the speed of 'e'
    >
    >
     
    Alexander Popov, May 26, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. donet programmer
    Replies:
    1
    Views:
    514
    donet programmer
    Dec 5, 2006
  2. Daniel Walzenbach

    How to create a TextBox containing a (clickable) Hyperlink??

    Daniel Walzenbach, Dec 2, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    348
    Daniel Walzenbach
    Dec 2, 2003
  3. Hels Bells
    Replies:
    5
    Views:
    387
    Bob Milutinovic
    Aug 8, 2007
  4. kylichuku
    Replies:
    12
    Views:
    246
  5. Matthias S.
    Replies:
    5
    Views:
    287
    Matthias S.
    Feb 9, 2011
Loading...

Share This Page