Hi all
vs2003, .NET1.1
I would like to store alignment values in SQL Server db and then use
them in C# to set values of cells in tables. Problem is that a string
variable will not work. Is there a way to set Alignment values from a
string variable?
string sValue = "Center"; //Comes from database in real application
//Find a particular cell in a table
System.Web.UI.WebControls.TableCell c =
(TableCell)Page.FindControl(sHeadCell);
//This line wont compile
cl.HorizontalAlign = sValue;
//This is what it is looking for:
cl.HorizontalAlign =HorizontalAlign.Center
//This has run time error that it cant convert:
cl.HorizontalAlign = (HorizontalAlign)sValue;
Any idea how to get :
"cl.HorizontalAlign = sValue;"
to work?
Thanks
Jeff