clickable boundcolumn is it possible

Discussion in 'ASP .Net Datagrid Control' started by rob merritt, Feb 17, 2004.

  1. rob merritt

    rob merritt Guest

    Hi I have a data grid with boundcolumns what I am trying to do is make
    the data that shows up in the bound columns clickable so as to be able
    to run the dgrid_select code (whic I now run from EditCommandColumn)

    any hints

    (sorry for the mess I am just kind of feeling my way around ASP.NET)



    <asp:datagrid id="dgrid" runat="server" Visible="False"
    oncancelcommand="dgrid_cancel" onupdatecommand="dgrid_update"
    oneditcommand="dgrid_select" onselectcommand="dgrid_select"
    gridlines="both" onitemcommand="dgrid_edit"
    autogeneratecolumns="false" align="left" datakeyfield="loginid">
    <Columns>
    <asp:BoundColumn DataField="loginid" ReadOnly="True" Visible="False"
    HeaderText="User Name"></asp:BoundColumn>
    <asp:BoundColumn DataField="lname" ReadOnly="True" HeaderText="Last
    Name" ></asp:BoundColumn>
    <asp:BoundColumn DataField="fname" ReadOnly="True" HeaderText="First
    Name" ></asp:BoundColumn>
    <asp:HyperLinkColumn HeaderText="Header"
    DataNavigateUrlField="loginid"
    DataNavigateUrlFormatString="nextPage.aspx?ID={0}" text
    ='<%#DataBinder.Eval(Container.DataItem, "loginid")%>'/>
    <asp:EditCommandColumn ButtonType="LinkButton" EditText="Select"
    ></asp:EditCommandColumn>

    </Columns>
    </asp:datagrid>
     
    rob merritt, Feb 17, 2004
    #1
    1. Advertising

  2. rob merritt

    rob merritt Guest

    templatecolumns

    <Columns>
    <asp:TemplateColumn HeaderText="Found">
    <ItemTemplate>
    <table border="0">
    <tr>
    <td><a href="javascript:__doPostBack('dgrid$_ctl2$_ctl0','')"><%#
    DataBinder.Eval(Container.DataItem, "lname") %> <%#
    DataBinder.Eval(Container.DataItem, "fname")%> </a></td>

    </tr>
    </table>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>
    </asp:datagrid>
    </Columns>

    (rob merritt) wrote in message news:<>...
    > Hi I have a data grid with boundcolumns what I am trying to do is make
    > the data that shows up in the bound columns clickable so as to be able
    > to run the dgrid_select code (whic I now run from EditCommandColumn)
    >
    > any hints
    >
    > (sorry for the mess I am just kind of feeling my way around ASP.NET)
    >
    >
    >
    > <asp:datagrid id="dgrid" runat="server" Visible="False"
    > oncancelcommand="dgrid_cancel" onupdatecommand="dgrid_update"
    > oneditcommand="dgrid_select" onselectcommand="dgrid_select"
    > gridlines="both" onitemcommand="dgrid_edit"
    > autogeneratecolumns="false" align="left" datakeyfield="loginid">
    > <Columns>
    > <asp:BoundColumn DataField="loginid" ReadOnly="True" Visible="False"
    > HeaderText="User Name"></asp:BoundColumn>
    > <asp:BoundColumn DataField="lname" ReadOnly="True" HeaderText="Last
    > Name" ></asp:BoundColumn>
    > <asp:BoundColumn DataField="fname" ReadOnly="True" HeaderText="First
    > Name" ></asp:BoundColumn>
    > <asp:HyperLinkColumn HeaderText="Header"
    > DataNavigateUrlField="loginid"
    > DataNavigateUrlFormatString="nextPage.aspx?ID={0}" text
    > ='<%#DataBinder.Eval(Container.DataItem, "loginid")%>'/>
    > <asp:EditCommandColumn ButtonType="LinkButton" EditText="Select"
    > ></asp:EditCommandColumn>

    > </Columns>
    > </asp:datagrid>
     
    rob merritt, Feb 17, 2004
    #2
    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.
Similar Threads
  1. May
    Replies:
    0
    Views:
    392
  2. Newton
    Replies:
    1
    Views:
    381
    Natty Gur
    Jul 27, 2003
  3. John
    Replies:
    3
    Views:
    3,264
    Giorgio Parmeggiani
    Nov 3, 2003
  4. Jim Heavey

    BoundColumn Visibility

    Jim Heavey, Nov 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    374
  5. mesut
    Replies:
    0
    Views:
    609
    mesut
    Jun 29, 2007
Loading...

Share This Page