Hi
Working with ASP.NET
I'm interogating each value in a datagrid with the ItemCreated event.
What i'm trying to do is, search for a specified string in a column, if it equals that then set the appropriate DataNavigateURL property, something like this:
DataGrid dg = (DataGrid)sender;
HyperLinkColumn hlk = null;
string str = (string)DataBinder.Eval(e.Item.DataItem, "Status"
if (str != null)
{
string strStatus = str.Trim();
if (strStatus == "FREE"
{
hlk = (HyperLinkColumn)dg.Columns[1];
hlk.DataNavigateUrlField = "RoomID";
hlk.DataNavigateUrlFormatString = "BookRoom.aspx?RoomID={0}";
This works fine, however
1) If i set this for just one row all of them become underlined, is there a way to just underline certain ones?
2) Can i have more than one querystring, ie i would like to do something like this;
hlk.DataNavigateUrlField = "RoomID,BookedBy";
hlk.DataNavigateUrlFormatString = "BookRoom.aspx?RoomID={0}&BookedBy={1}";
But that doesn't work.
Help appreciated.
Working with ASP.NET
I'm interogating each value in a datagrid with the ItemCreated event.
What i'm trying to do is, search for a specified string in a column, if it equals that then set the appropriate DataNavigateURL property, something like this:
DataGrid dg = (DataGrid)sender;
HyperLinkColumn hlk = null;
string str = (string)DataBinder.Eval(e.Item.DataItem, "Status"
if (str != null)
{
string strStatus = str.Trim();
if (strStatus == "FREE"
{
hlk = (HyperLinkColumn)dg.Columns[1];
hlk.DataNavigateUrlField = "RoomID";
hlk.DataNavigateUrlFormatString = "BookRoom.aspx?RoomID={0}";
This works fine, however
1) If i set this for just one row all of them become underlined, is there a way to just underline certain ones?
2) Can i have more than one querystring, ie i would like to do something like this;
hlk.DataNavigateUrlField = "RoomID,BookedBy";
hlk.DataNavigateUrlFormatString = "BookRoom.aspx?RoomID={0}&BookedBy={1}";
But that doesn't work.
Help appreciated.