DataGrid Control Question

S

Samuel Shulman

Hi

I added a number of columns to the DataGrid control and I binded them to
ceratin columns in the DataView object however I want to fill the URL of the
HyperLink type column and I want to add images to the image column

What is the normal way of doing that?
Samuel
 
E

Eliyahu Goldin

Samuel,

The most flexible is to handle ItemDataBound event in code-behind. The event
handler gets a reference to the item (row) of the datagrid. You can set any
properties of the cells as you wish.
 
S

Samuel Shulman

Thank you for your response,

I am still not sure which are the properties to set (the image path and the
URL) is it the Celles(Index) of the relevant row?

Thank you,
Samuel


Eliyahu Goldin said:
Samuel,

The most flexible is to handle ItemDataBound event in code-behind. The
event handler gets a reference to the item (row) of the datagrid. You can
set any properties of the cells as you wish.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
Hi

I added a number of columns to the DataGrid control and I binded them to
ceratin columns in the DataView object however I want to fill the URL of
the HyperLink type column and I want to add images to the image column

What is the normal way of doing that?
Samuel
 
E

Eliyahu Goldin

Cells(Index) will point you to a cell. The content of the cell depends on
it's type. If you are not sure what is inside, you can always set a
breakpoint somewhere in the ItemDataBound event and explore the content of
the cell in the debugger.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
Thank you for your response,

I am still not sure which are the properties to set (the image path and
the URL) is it the Celles(Index) of the relevant row?

Thank you,
Samuel


Eliyahu Goldin said:
Samuel,

The most flexible is to handle ItemDataBound event in code-behind. The
event handler gets a reference to the item (row) of the datagrid. You can
set any properties of the cells as you wish.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
Hi

I added a number of columns to the DataGrid control and I binded them to
ceratin columns in the DataView object however I want to fill the URL of
the HyperLink type column and I want to add images to the image column

What is the normal way of doing that?
Samuel
 
S

Samuel Shulman

Can't figure out the type of the specific cell (the type I see is
DataControlFieldCell )

and this doesn't help at all

Samuel


Eliyahu Goldin said:
Cells(Index) will point you to a cell. The content of the cell depends on
it's type. If you are not sure what is inside, you can always set a
breakpoint somewhere in the ItemDataBound event and explore the content of
the cell in the debugger.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Samuel Shulman said:
Thank you for your response,

I am still not sure which are the properties to set (the image path and
the URL) is it the Celles(Index) of the relevant row?

Thank you,
Samuel


Eliyahu Goldin said:
Samuel,

The most flexible is to handle ItemDataBound event in code-behind. The
event handler gets a reference to the item (row) of the datagrid. You
can set any properties of the cells as you wish.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Hi

I added a number of columns to the DataGrid control and I binded them
to ceratin columns in the DataView object however I want to fill the
URL of the HyperLink type column and I want to add images to the image
column

What is the normal way of doing that?
Samuel
 

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

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,266
Latest member
DavidaAlla

Latest Threads

Top