Splitting rows in dataGrid
-
Dear all... I have a dataGrid control, can I split a specific row into many rows ? Regards...
Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
Yes why not. Just place controls into datagrid and eval the split value using ItemDataBound event. Use
DataBinder.Eval("YourColumn").Split(" ")
Is this what you want? I think using Repeater will be better in this case. ;)Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
Yes why not. Just place controls into datagrid and eval the split value using ItemDataBound event. Use
DataBinder.Eval("YourColumn").Split(" ")
Is this what you want? I think using Repeater will be better in this case. ;)Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
thanks dear 4 your reply, I put this line of code but it does not work well regards
Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
Where did you put? I think you need to put it under DataBound Event handler. Might be by this way :
private void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
if(e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells(1).Text = "_" + DataBinder.Eval(e.Row.DataItem, "colname").ToString().Split(" ") + "_"; }
}
The split logic should be placed according to what you require. Also adjust the code according to what you need. ;)
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
Where did you put? I think you need to put it under DataBound Event handler. Might be by this way :
private void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
if(e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells(1).Text = "_" + DataBinder.Eval(e.Row.DataItem, "colname").ToString().Split(" ") + "_"; }
}
The split logic should be placed according to what you require. Also adjust the code according to what you need. ;)
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
thanks alot it works
Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)