Need line break and hyper link in GridView
-
Hello everybody, i have two issues.. in my application I have DataTable which contain all the values.My dataTable contain 3 columns and rows depend on the data.Later on I assign the datatable to a gridview. I want to put line break in the last column of the Gridview and in the 2nd column i need the data should be hyperlink to a pgeUrl. i use VS2005 plz help me out..
A key to every Solution
-
Hello everybody, i have two issues.. in my application I have DataTable which contain all the values.My dataTable contain 3 columns and rows depend on the data.Later on I assign the datatable to a gridview. I want to put line break in the last column of the Gridview and in the 2nd column i need the data should be hyperlink to a pgeUrl. i use VS2005 plz help me out..
A key to every Solution
For a new line break you can use this syntax in the inline code
DataBinder.Eval(Container.DataItem, "ColName").ToString().Replace(Environment.NewLine,"<br/>")
For a Hyperlink Column on the Gridview control, you can check the sample code Here[^]- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
-
For a new line break you can use this syntax in the inline code
DataBinder.Eval(Container.DataItem, "ColName").ToString().Replace(Environment.NewLine,"<br/>")
For a Hyperlink Column on the Gridview control, you can check the sample code Here[^]- Regards -
JON
Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
where I v to writhe the code before bind the datasource or in aspx page. my code is as below DataColumn dcol = new DataColumn(Var_ColumnName1, typeof(System.String)); subsGift_DataTable.Columns.Add(dcol); lke other two column.. DataRow dr_Gift = subsGift_DataTable.NewRow(); dr_Datarow[Var_ColumnName1] = "SomeValue"); dr_Datarow[Var_ColumnName2] = SomeValue2; dr_Datarow[Var_ColumnName3] =" Name: Address: PhoneNo: "; subsGift_DataTable.Rows.Add(dr_Gift); MyGridView.DataSource = subsGift_DataTable; MyGridView.DataBind(); I need data shown in Column3 in linebreak like Name: Address: PhoneNo: and the address sould be hyperlink..
A key to every Solution