AccessingCells

Discussion in 'ASP .Net' started by gh, Mar 5, 2005.

  1. gh

    gh Guest

    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
     
    gh, Mar 5, 2005
    #1
    1. Advertising

  2. 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


    >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.
     
    Calvin Luttrell, Mar 5, 2005
    #2
    1. Advertising

  3. 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

    "gh" <> wrote in message
    news:%...
    > 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
     
    Eliyahu Goldin, Mar 6, 2005
    #3
  4. gh

    gh Guest

    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

    Eliyahu Goldin wrote:
    > 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
    >
    > "gh" <> wrote in message
    > news:%...
    >
    >>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

    >
    >
    >
     
    gh, Mar 6, 2005
    #4
  5. Show your html.

    Eliyahu

    "gh" <> wrote in message
    news:...
    > 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
    >
    > Eliyahu Goldin wrote:
    > > 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
    > >
    > > "gh" <> wrote in message
    > > news:%...
    > >
    > >>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

    > >
    > >
    > >
     
    Eliyahu Goldin, Mar 6, 2005
    #5
  6. 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 Arbuckle, Mar 6, 2005
    #6
  7. 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.




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Patrick Olurotimi Ige, Mar 7, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page