Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DropDownList show the name of columns of dataGrid

Reply
Thread Tools

DropDownList show the name of columns of dataGrid

 
 
dalbo
Guest
Posts: n/a
 
      08-24-2005
Hello, I make a dataGrid and i like to show the name of the columns of the
dataGrid in a DropDownList. For example, if my dataGrid have three columns
called "NAME" "ADDRESS" "CITY" i like show "NAME" "ADDRESS" "CITY" in the
DropDownList.

Thanks David, and sorry for my poor english.
 
Reply With Quote
 
 
 
 
dalbo
Guest
Posts: n/a
 
      08-24-2005
Yes, I know and in my DataGrid i see the name of the columns. But my problem
is i need to make a new DropDownList with the name of the columns.

"Eliyahu Goldin" escribió:

> You can find the names of the columns in the datagrid Columns property
> unless the grid is AutoGenerated.
>
> Eliyahu
>
> "dalbo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello, I make a dataGrid and i like to show the name of the columns of the
> > dataGrid in a DropDownList. For example, if my dataGrid have three columns
> > called "NAME" "ADDRESS" "CITY" i like show "NAME" "ADDRESS" "CITY" in the
> > DropDownList.
> >
> > Thanks David, and sorry for my poor english.

>
>
>

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      08-24-2005
You can find the names of the columns in the datagrid Columns property
unless the grid is AutoGenerated.

Eliyahu

"dalbo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello, I make a dataGrid and i like to show the name of the columns of the
> dataGrid in a DropDownList. For example, if my dataGrid have three columns
> called "NAME" "ADDRESS" "CITY" i like show "NAME" "ADDRESS" "CITY" in the
> DropDownList.
>
> Thanks David, and sorry for my poor english.



 
Reply With Quote
 
dalbo
Guest
Posts: n/a
 
      08-24-2005
The problem is i have a dataGrid with three columns called NAME ADDRESS CITY.
If i create a DropDownList and i use
DropDownList1.DataTextField = "NOMBRE"; in my DropDownList i see the list of
names but i like to do something that this
DropDownList1.DataTextField = "?????????"; to see in the DropDownList
NAME,ADDRESS,CITY ,it is to say, the name of the columns.

Thanks for the help and sorry for my poor english again.

David.

Example of table

NAME | ADDRESS | CITY
| |
David | Micasa | habichuelas
Otro | distinto | mas

"Eliyahu Goldin" escribió:

> Can you elaborate what exactly the problem is? Creating a ddl? Populating it
> with column names? What did you try that didn't work for you?
>
> Eliyahu
>
> "dalbo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Yes, I know and in my DataGrid i see the name of the columns. But my

> problem
> > is i need to make a new DropDownList with the name of the columns.
> >
> > "Eliyahu Goldin" escribió:
> >
> > > You can find the names of the columns in the datagrid Columns property
> > > unless the grid is AutoGenerated.
> > >
> > > Eliyahu
> > >
> > > "dalbo" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Hello, I make a dataGrid and i like to show the name of the columns of

> the
> > > > dataGrid in a DropDownList. For example, if my dataGrid have three

> columns
> > > > called "NAME" "ADDRESS" "CITY" i like show "NAME" "ADDRESS" "CITY" in

> the
> > > > DropDownList.
> > > >
> > > > Thanks David, and sorry for my poor english.
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      08-24-2005
Can you elaborate what exactly the problem is? Creating a ddl? Populating it
with column names? What did you try that didn't work for you?

Eliyahu

"dalbo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Yes, I know and in my DataGrid i see the name of the columns. But my

problem
> is i need to make a new DropDownList with the name of the columns.
>
> "Eliyahu Goldin" escribió:
>
> > You can find the names of the columns in the datagrid Columns property
> > unless the grid is AutoGenerated.
> >
> > Eliyahu
> >
> > "dalbo" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hello, I make a dataGrid and i like to show the name of the columns of

the
> > > dataGrid in a DropDownList. For example, if my dataGrid have three

columns
> > > called "NAME" "ADDRESS" "CITY" i like show "NAME" "ADDRESS" "CITY" in

the
> > > DropDownList.
> > >
> > > Thanks David, and sorry for my poor english.

> >
> >
> >



 
Reply With Quote
 
dalbo
Guest
Posts: n/a
 
      08-24-2005
This is the problem, there can be a different set of columns because the
table of the DataGrid it is going to change very frequently. And i don't know
how many columns have the new table.

David

"Eliyahu Goldin" escribió:

> David,
>
> Will the dropdownlist always contain items NAME,ADDRESS,CITY? Or there can
> be a different set of columns depending on the table bound to the datagrid?
>
> Eliyahu
>
> "dalbo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > The problem is i have a dataGrid with three columns called NAME ADDRESS

> CITY.
> > If i create a DropDownList and i use
> > DropDownList1.DataTextField = "NOMBRE"; in my DropDownList i see the list

> of
> > names but i like to do something that this
> > DropDownList1.DataTextField = "?????????"; to see in the DropDownList
> > NAME,ADDRESS,CITY ,it is to say, the name of the columns.
> >
> > Thanks for the help and sorry for my poor english again.
> >
> > David.
> >
> > Example of table
> >
> > NAME | ADDRESS | CITY
> > | |
> > David | Micasa | habichuelas
> > Otro | distinto | mas
> >
> > "Eliyahu Goldin" escribió:
> >
> > > Can you elaborate what exactly the problem is? Creating a ddl?

> Populating it
> > > with column names? What did you try that didn't work for you?
> > >
> > > Eliyahu
> > >
> > > "dalbo" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Yes, I know and in my DataGrid i see the name of the columns. But my
> > > problem
> > > > is i need to make a new DropDownList with the name of the columns.
> > > >
> > > > "Eliyahu Goldin" escribió:
> > > >
> > > > > You can find the names of the columns in the datagrid Columns

> property
> > > > > unless the grid is AutoGenerated.
> > > > >
> > > > > Eliyahu
> > > > >
> > > > > "dalbo" <(E-Mail Removed)> wrote in message
> > > > > news:(E-Mail Removed)...
> > > > > > Hello, I make a dataGrid and i like to show the name of the

> columns of
> > > the
> > > > > > dataGrid in a DropDownList. For example, if my dataGrid have three
> > > columns
> > > > > > called "NAME" "ADDRESS" "CITY" i like show "NAME" "ADDRESS" "CITY"

> in
> > > the
> > > > > > DropDownList.
> > > > > >
> > > > > > Thanks David, and sorry for my poor english.
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      08-24-2005
David,

Will the dropdownlist always contain items NAME,ADDRESS,CITY? Or there can
be a different set of columns depending on the table bound to the datagrid?

Eliyahu

"dalbo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The problem is i have a dataGrid with three columns called NAME ADDRESS

CITY.
> If i create a DropDownList and i use
> DropDownList1.DataTextField = "NOMBRE"; in my DropDownList i see the list

of
> names but i like to do something that this
> DropDownList1.DataTextField = "?????????"; to see in the DropDownList
> NAME,ADDRESS,CITY ,it is to say, the name of the columns.
>
> Thanks for the help and sorry for my poor english again.
>
> David.
>
> Example of table
>
> NAME | ADDRESS | CITY
> | |
> David | Micasa | habichuelas
> Otro | distinto | mas
>
> "Eliyahu Goldin" escribió:
>
> > Can you elaborate what exactly the problem is? Creating a ddl?

Populating it
> > with column names? What did you try that didn't work for you?
> >
> > Eliyahu
> >
> > "dalbo" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Yes, I know and in my DataGrid i see the name of the columns. But my

> > problem
> > > is i need to make a new DropDownList with the name of the columns.
> > >
> > > "Eliyahu Goldin" escribió:
> > >
> > > > You can find the names of the columns in the datagrid Columns

property
> > > > unless the grid is AutoGenerated.
> > > >
> > > > Eliyahu
> > > >
> > > > "dalbo" <(E-Mail Removed)> wrote in message
> > > > news:(E-Mail Removed)...
> > > > > Hello, I make a dataGrid and i like to show the name of the

columns of
> > the
> > > > > dataGrid in a DropDownList. For example, if my dataGrid have three

> > columns
> > > > > called "NAME" "ADDRESS" "CITY" i like show "NAME" "ADDRESS" "CITY"

in
> > the
> > > > > DropDownList.
> > > > >
> > > > > Thanks David, and sorry for my poor english.
> > > >
> > > >
> > > >

> >
> >
> >



 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      08-24-2005
You need to databind the ddl to the datagrid Column collection. Try

<aspropDownList ... DataSource = <%# myGrid.Columns %>
DataTextField="HeaderText">

Alternatively you can do it in the code. Note again, that this will work
only for non-AutoGenerated columns.

Eliyahu

"dalbo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> This is the problem, there can be a different set of columns because the
> table of the DataGrid it is going to change very frequently. And i don't

know
> how many columns have the new table.
>
> David
>
> "Eliyahu Goldin" escribió:
>
> > David,
> >
> > Will the dropdownlist always contain items NAME,ADDRESS,CITY? Or there

can
> > be a different set of columns depending on the table bound to the

datagrid?
> >
> > Eliyahu
> >
> > "dalbo" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > The problem is i have a dataGrid with three columns called NAME

ADDRESS
> > CITY.
> > > If i create a DropDownList and i use
> > > DropDownList1.DataTextField = "NOMBRE"; in my DropDownList i see the

list
> > of
> > > names but i like to do something that this
> > > DropDownList1.DataTextField = "?????????"; to see in the DropDownList
> > > NAME,ADDRESS,CITY ,it is to say, the name of the columns.
> > >
> > > Thanks for the help and sorry for my poor english again.
> > >
> > > David.
> > >
> > > Example of table
> > >
> > > NAME | ADDRESS | CITY
> > > | |
> > > David | Micasa | habichuelas
> > > Otro | distinto | mas
> > >
> > > "Eliyahu Goldin" escribió:
> > >
> > > > Can you elaborate what exactly the problem is? Creating a ddl?

> > Populating it
> > > > with column names? What did you try that didn't work for you?
> > > >
> > > > Eliyahu
> > > >
> > > > "dalbo" <(E-Mail Removed)> wrote in message
> > > > news:(E-Mail Removed)...
> > > > > Yes, I know and in my DataGrid i see the name of the columns. But

my
> > > > problem
> > > > > is i need to make a new DropDownList with the name of the columns.
> > > > >
> > > > > "Eliyahu Goldin" escribió:
> > > > >
> > > > > > You can find the names of the columns in the datagrid Columns

> > property
> > > > > > unless the grid is AutoGenerated.
> > > > > >
> > > > > > Eliyahu
> > > > > >
> > > > > > "dalbo" <(E-Mail Removed)> wrote in message
> > > > > > news:(E-Mail Removed)...
> > > > > > > Hello, I make a dataGrid and i like to show the name of the

> > columns of
> > > > the
> > > > > > > dataGrid in a DropDownList. For example, if my dataGrid have

three
> > > > columns
> > > > > > > called "NAME" "ADDRESS" "CITY" i like show "NAME" "ADDRESS"

"CITY"
> > in
> > > > the
> > > > > > > DropDownList.
> > > > > > >
> > > > > > > Thanks David, and sorry for my poor english.
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >

> >
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show array values as columns in a datagrid mavrick_101 ASP .Net 1 06-10-2010 12:56 PM
convert rows to columns and columns to rows helpful sql ASP .Net 0 05-19-2005 06:03 PM
How to show in a datagrid columns of different datatables? Luis Esteban Valencia ASP .Net 7 09-29-2004 02:59 AM
Binded Datagrid Formatting columns or hiding columns ton ASP .Net Web Controls 2 02-11-2004 04:09 AM
Columns and Inherited Datagrid...Active Schema does not support columns rob thomson ASP .Net Datagrid Control 0 09-04-2003 03:09 PM



Advertisments