AccessingCells

  • Thread starter Thread starter gh
  • Start date Start date
G

gh

I have an aspx page that has an html table on it. The table has 4
columns with 6 rows and each cell has a hyperlink defined in it, except
for the last column. When the page is created I have a dataset I loop
through and I check the hyperlink id in html table for an id match in
the dataset. If there is a match I leave the hyperlink enabled, if not
I disable the hyperlink. If all the columns across have enabled
hyperlinks I need to add an image to the last cell in the row. Can this
be done at runtime with the hyperlinks already setup on the aspx page or
should I create the html table dynamically? If I create the table
dynamically, how do I add the 2nd, 3rd, and 4th columns? The columns
need to be populated 6 down, then goto next column and populate 6 down.

Thanks
 
Dear GH,

You can run that Table as a server control and access it programmatically. This means you would build the table with the table object verses writing the HTML yourself.

-Calvin Luttrell
ProjectThunder.com, Inc.
nothing is impossible
 
Yes, you can setup everything, including the image in the last cell, at
design time.

Write a method that will accept a hyperlink id as a parameter and return
true or false depending on if the id is present in the dataset or not. In
Page_Load event call this function for every hyperlink. Then show/hide the
image according to the logic required. Looks pretty straightforward.

Eliyahu
 
Eliyahu:

I have tried to do this, but when I loop through the html table it
doesn' t recognize the number of rows. The row count is always = to 0.

Thanks
 
Show your html.

Eliyahu

gh said:
Eliyahu:

I have tried to do this, but when I loop through the html table it
doesn' t recognize the number of rows. The row count is always = to 0.

Thanks
 
A Datalist or Datagrid would also work. I've done a similar application
with sample audio clips. If there is no sample audio URL then the
'Listen' text/image will still show up but it won't link to anything.
The DataList and DataGrid also build the table for you so there is no
HTML to worry about.

Hope this helps.

ps. You can preset the number of Columns with your DataList and it will
be automatically fill out rows.
 
Sparky ..
i'm also planning to implement a similar stuff in my project.Is it
possible to show a different links or data in a datagrid cell depending
on who is logged on?
For example if i have links in a datagrid and i want to disable some
cells and make others visible.
 
Back
Top