Showing posts with label cell. Show all posts
Showing posts with label cell. Show all posts

Saturday, March 24, 2012

newbie DropDownList inside a GridView cell question

Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
to a DataTable Row element that contains a foriegn key in the data record.
For the DropDownList items, I need data from the primary key in another
table. It almost looks like the DropDownList needs binding to two separate
tables. Is that possible? If so, can someone tell me which DropDownList
property references the foreign key table and which one references the
primary key table?

Thanks,

KeithLook at the source code of this demo:
http://www.webswapp.com/codesamples...s/gridview.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

"keithb" wrote:

> Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
> to a DataTable Row element that contains a foriegn key in the data record.
> For the DropDownList items, I need data from the primary key in another
> table. It almost looks like the DropDownList needs binding to two separate
> tables. Is that possible? If so, can someone tell me which DropDownList
> property references the foreign key table and which one references the
> primary key table?
> Thanks,
> Keith
>

newbie DropDownList inside a GridView cell question

Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bound
to a DataTable Row element that contains a foriegn key in the data record.
For the DropDownList items, I need data from the primary key in another
table. It almost looks like the DropDownList needs binding to two separate
tables. Is that possible? If so, can someone tell me which DropDownList
property references the foreign key table and which one references the
primary key table?
Thanks,
KeithLook at the source code of this demo:
http://www.webswapp.com/codesamples...s/gridview.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"keithb" wrote:

> Using ASP.NET 2.0, I need to a DropDownList in a GridView cell that is bou
nd
> to a DataTable Row element that contains a foriegn key in the data record.
> For the DropDownList items, I need data from the primary key in another
> table. It almost looks like the DropDownList needs binding to two separate
> tables. Is that possible? If so, can someone tell me which DropDownList
> property references the foreign key table and which one references the
> primary key table?
> Thanks,
> Keith
>
>

Newbie dynamic color question

I am trying to use Visual Studio to change the color of a cell on the page load. I am trying to do this in the code behind using VB. I can do a table:


MyTable.BackColor = Color.Red

But I can't seem to do a table cell. I have tried this:


MyTable.Rows(1).Cells(1).BackColor = Color.Blue

With this I get the error:

"Specified argument was out of the range of valid values. Parameter name: index "

I have tried inheriting the namespace "System.Drawing"
Can this be done, if so how? If not, how would I do this normally with VB?

ThanksThis means that the row or cell does not exist. Namely, the index of the first row in table is 0, not 1. Same goes for the cells.

So if you have only one row and only one cell, you get an error.

Try

MyTable.Rows(0).Cells(0).BackColor = Color.Blue


I looked back on it and adjusted my code to row 0 and cell 0. I can now get the row to change color, but regardless of what cell I call, it changes the entire row. I tried putting an entry for two cells in the same row, but it just ignores the anything after the first call. Any ideas?