Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Location
    Perth, Western Australia, Australia
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MxDataGrid Display Problems

    Hi All,

    I am new to using Asp.Net and I have found myself in a little bit of a pickle!!! What I have is an MxDataGrid (attached to an AccessDataSouceControl) displaying 4 columns (Name1, ID2 & Name2) I need to make the Name2 field a link (to a generic page) and I need it to pass the value from the field ID2 to the next page. However I have no idea how to go about doing this. I would also like to be able to make the ID2 column not display on the page but I still need to be able to access the values in this column.

    Any help would be greatly appreciated.

    thanks

    Vicki

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MxDataGrid Display Problems

    Hi Vicki,

    You mentioned MxDataGrid - are you using Dreamweaver as your development tool? I've stayed mostly within Visual Studio, so my suggestions will come with that in mind, but should still be applicable even if you used Notepad to write the code...

    What you need here is a Template Column rather than a Bound Column. You can build the controls you choose in a template column, rather than being tied to a single value in a Bound colum. The syntax for the colum would be like this:<pre><asp:TemplateColumn headertext="My Column Name">
    <ItemTemplate>
    <a href='<%# "YourPage.aspx?p=" &
    DataBinder.Eval(Container.DataItem, "YourParameterValue") %>'>
    <%# DataBinder.Eval(Container.DataItem, "YourLinkName") %></a>
    </ItemTemplate>
    </asp:TemplateColumn> </pre>

    Notice, I entered the name of an ASPX page with the querystring parameter of "p", then the value of the parameter which will come from my selected database field ("YourParameterName"). Finally, I added the text of the link from another Database field ("YourLinkName').

    For more details, search Google for "ASP.NET Template Column"

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Location
    Perth, Western Australia, Australia
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MxDataGrid Display Problems

    Thanks for that I have managed to get it to do what I wanted it to do! You are a legend!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •