clickable boundcolumn is it possible

R

rob merritt

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
=' said:
</asp:EditCommandColumn>
</Columns>
</asp:datagrid>
 
R

rob merritt

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top