R
RobT
Hi,
I've been using the DataGrid control in my ASP.NET web page. The page is
used to search for records in the database. The control is bound to a
DataSource and gets populated ok. I am also using a Hyperlink column in
the grid to allow the user to redirect to another page, again that works
fine.
My problem is when I want to call the ASP.NET search page from more than
one page because I cannot find a way to programatically set the
"DataNavigateUrlFormatString" property of the HyperLink control. I need
to do this to allow the page to navigate to different pages depending on
which page called this page.
Any help would be appreciated, I've added the code from my control below
but would like to be able to set the DataNavigationUrlFormatString
property to something like
DataNavigateUrlFormatString="<%=MyString%>"
instead of
PublicFunder.aspx?FunderID={0}
But this does not seem to work.
Thanks in advance
Rob
<asp:datagrid id="grdSearchResults" tabIndex="6" runat="server"
CssClass="Grid" Width="457px"
Visible="False" AutoGenerateColumns="False">
<AlternatingItemStyle CssClass="GridAlternatingRow
"></AlternatingItemStyle>
<HeaderStyle CssClass="GridHeader"></HeaderStyle>
<Columns>
<asp:HyperLinkColumn Text="Choose" DataNavigateUrlField="FunderID"
DataNavigateUrlFormatString="PublicFunder.aspx?FunderID={0}"></asp:Hyper
LinkColumn>
<asp:BoundColumn DataField="FunderId" ReadOnly="True"
HeaderText="Funder Id"></asp:BoundColumn>
<asp:BoundColumn DataField="FunderName" ReadOnly="True"
HeaderText="Name"></asp:BoundColumn>
</Columns>
</asp:datagrid>
I've been using the DataGrid control in my ASP.NET web page. The page is
used to search for records in the database. The control is bound to a
DataSource and gets populated ok. I am also using a Hyperlink column in
the grid to allow the user to redirect to another page, again that works
fine.
My problem is when I want to call the ASP.NET search page from more than
one page because I cannot find a way to programatically set the
"DataNavigateUrlFormatString" property of the HyperLink control. I need
to do this to allow the page to navigate to different pages depending on
which page called this page.
Any help would be appreciated, I've added the code from my control below
but would like to be able to set the DataNavigationUrlFormatString
property to something like
DataNavigateUrlFormatString="<%=MyString%>"
instead of
PublicFunder.aspx?FunderID={0}
But this does not seem to work.
Thanks in advance
Rob
<asp:datagrid id="grdSearchResults" tabIndex="6" runat="server"
CssClass="Grid" Width="457px"
Visible="False" AutoGenerateColumns="False">
<AlternatingItemStyle CssClass="GridAlternatingRow
"></AlternatingItemStyle>
<HeaderStyle CssClass="GridHeader"></HeaderStyle>
<Columns>
<asp:HyperLinkColumn Text="Choose" DataNavigateUrlField="FunderID"
DataNavigateUrlFormatString="PublicFunder.aspx?FunderID={0}"></asp:Hyper
LinkColumn>
<asp:BoundColumn DataField="FunderId" ReadOnly="True"
HeaderText="Funder Id"></asp:BoundColumn>
<asp:BoundColumn DataField="FunderName" ReadOnly="True"
HeaderText="Name"></asp:BoundColumn>
</Columns>
</asp:datagrid>