Ask a Question related to ASP.NET Data Grid Control, Design and Development.
- Jonas Nilsson #1
Web Control that inherits the DataGrid Hi!
Does anyone have a sample on how i can inherit the datagrid in a Web Control
and bind it to a datasource.
And then add template columns and add data from the datasource into the
columns
My Web Control inherits the DataGrid, i bind the control to a datasource
(DataReader) in my aspx code (Page_Load event)
But i can't get data from the DataItem in OnItemDataBound event in my Web
Control.
protected override void OnItemDataBound(DataGridItemEventArgs e)
{
LinkButton lb = new LinkButton();
lb.ID = "lbNav";
*** This row causes a "Object reference not set to an instance of an
object" ***
lb.Text = ((DataRowView)e.Item.DataItem).Row.ItemArray[1].ToString();
e.Item.Cells[0].Controls.Add(lb);
base.OnItemDataBound (e);
}
/Jonas
Jonas Nilsson Guest
-
Textbox2 control that inherits from Textbox
Hi Guys, I have a huge problem....I think. I have created a control called Textbox2 which basically inherits from Textbox. Now my problem is... -
DataGrid with Inherits
Hi I didn't have any problem with DataGrid with the Inherits options (ie. an aspx page with the corresponding code in assembly) even with sorting. ... -
Is it possible to inherits from SoapException to create custom exception
Hi all, I try to create a class who inherits from SoapException Public class SoapExceptionTst inherits SoapException public sub new (....)... -
Control derived from datagrid, problem with adding other control and databinding (VB)
I all, my employer required me to add a bunch of control to a datagrid (such as a drop down list on top corner to select page size and prev, bunch... -
How to change what the Web Service Proxy class inherits from?
I am successfully using SoapExtensionImporter to change how the web service proxy class is generated when I add web reference in VS. However, this... - Noel Hoo #2
Re: Web Control that inherits the DataGrid Morning Jonas,
Try this link
[url]http://msdn.microsoft.com/msdnmag/issues/01/10/cutting/cutting0110.asp[/url]
Build a Variety of Custom Controls Based on the DataGrid Control by Dino
Esposito
He rocks!!
Hope this helps,
--
Noel Hoo
[email][email protected][/email]
"Jonas Nilsson" <[email protected]> wrote in message
news:[email protected]..Control> Hi!
>
> Does anyone have a sample on how i can inherit the datagrid in a Web> and bind it to a datasource.
> And then add template columns and add data from the datasource into the
> columns
>
> My Web Control inherits the DataGrid, i bind the control to a datasource
> (DataReader) in my aspx code (Page_Load event)
>
> But i can't get data from the DataItem in OnItemDataBound event in my Web
> Control.
>
> protected override void OnItemDataBound(DataGridItemEventArgs e)
> {
> LinkButton lb = new LinkButton();
> lb.ID = "lbNav";
>
> *** This row causes a "Object reference not set to an instance of an
> object" ***
> lb.Text = ((DataRowView)e.Item.DataItem).Row.ItemArray[1].ToString();
>
> e.Item.Cells[0].Controls.Add(lb);
> base.OnItemDataBound (e);
> }
>
> /Jonas
>
>
>
Noel Hoo Guest




