473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

DataGrid Control Question

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
Sep 17 '06 #1
4 1446
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" <sa************@ntlworld.comwrote in message
news:OG**************@TK2MSFTNGP06.phx.gbl...
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


Sep 17 '06 #2
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" <RE**************************@mMvVpPsS.orgwrote in
message news:e6**************@TK2MSFTNGP04.phx.gbl...
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" <sa************@ntlworld.comwrote in message
news:OG**************@TK2MSFTNGP06.phx.gbl...
>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



Sep 17 '06 #3
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" <sa************@ntlworld.comwrote in message
news:uF**************@TK2MSFTNGP03.phx.gbl...
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" <RE**************************@mMvVpPsS.orgwrote in
message news:e6**************@TK2MSFTNGP04.phx.gbl...
>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" <sa************@ntlworld.comwrote in message
news:OG**************@TK2MSFTNGP06.phx.gbl...
>>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




Sep 17 '06 #4
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" <RE**************************@mMvVpPsS.orgwrote in
message news:O7**************@TK2MSFTNGP04.phx.gbl...
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" <sa************@ntlworld.comwrote in message
news:uF**************@TK2MSFTNGP03.phx.gbl...
>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" <RE**************************@mMvVpPsS.orgwrote in
message news:e6**************@TK2MSFTNGP04.phx.gbl...
>>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" <sa************@ntlworld.comwrote in message
news:OG**************@TK2MSFTNGP06.phx.gbl...
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




Sep 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
2
by: Sky | last post by:
Hello: Another question about trying to wring functionality from a DataGrid... Have a DB table of "Contacts" -- 14 or more fields per record Show in datagrid -- but only 5 columns (First,Last,...
10
by: Jennyfer J Barco | last post by:
Hello, I have a datagrid that brings some information from a query. I need to have a checkbox in each row so the user can select the rows he wants to reprint. Is it possible to have a checkbox...
0
by: Gujju | last post by:
Hi all, Have a question from the following post to create user control in a Datagrid.... http://www.dotnet247.com/247reference/msgs/45/225337.aspx I have a question.... I can create the...
3
by: Skowronek | last post by:
What is the best method to obtain a data value from a parent datagriditem from a child datagrid - datagrid footer item command event handler? Here is the layout of my asp.net controls ...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
7
by: Mark B | last post by:
Can someone write some VB.Net example code for me that does this: 1) Creates a gridview control with the results of a SQL stored procedure that has 1 parameter (text) 2) Adds an extra column...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.