Create server controls containing DataGrid

J

J Gopinath

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'
 
A

Alexander Popov

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 said:
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 ------------------------------------------------------------------------
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top