A
Allen K
Hi,
I'm programmatically creating a HyperLink column for my datagrd ( in
addition to Bound Columns created through the VS.NET Visual Interface ).
However, when a Postback occurs, this column simply disappears, as if it
doesn't exist in ViewState.. However, the columns I created in the VS.NET
DataGrid editor appear just fine.. Can someone help me??
Heres my code:
private void Page_Load( object sender, System.EventArgs e )
{
HyperLinkColumn viewDetails = new HyperLinkColumn();
viewDetails.DataNavigateUrlField = UConst.COL_USERID;
viewDetails.DataNavigateUrlFormatString =
Constants.URL_VIEWUSER + "?userID={0}";
viewDetails.Text = "View Details";
viewDetails.HeaderText = "Details";
TemplateColumn vd = new TemplateColumn();
dgSearchResults.Columns.Add( viewDetails );
if( !IsPostBack )
{
Initialize();
//SetupDataGridColumns();
}
}
I've also tried adding this to the If( !IsPostBack ) block and that
doesn't seem to work either..
Any help would be much appreciated! Thanks!
Allen
I'm programmatically creating a HyperLink column for my datagrd ( in
addition to Bound Columns created through the VS.NET Visual Interface ).
However, when a Postback occurs, this column simply disappears, as if it
doesn't exist in ViewState.. However, the columns I created in the VS.NET
DataGrid editor appear just fine.. Can someone help me??
Heres my code:
private void Page_Load( object sender, System.EventArgs e )
{
HyperLinkColumn viewDetails = new HyperLinkColumn();
viewDetails.DataNavigateUrlField = UConst.COL_USERID;
viewDetails.DataNavigateUrlFormatString =
Constants.URL_VIEWUSER + "?userID={0}";
viewDetails.Text = "View Details";
viewDetails.HeaderText = "Details";
TemplateColumn vd = new TemplateColumn();
dgSearchResults.Columns.Add( viewDetails );
if( !IsPostBack )
{
Initialize();
//SetupDataGridColumns();
}
}
I've also tried adding this to the If( !IsPostBack ) block and that
doesn't seem to work either..
Any help would be much appreciated! Thanks!
Allen