Simple Dataset Question...
-
in C# /w asp.net using SQL... (which forum, lol) i have a dataset that i bind to a html datagrid, is there anyway i can manipulate the data in between the grab from the database, and the posting into the table? i just want to do some simple replaces... to replace some strings with images, etc... things i can't do with simple formatting... this is NOT for posting back to the db...
-
in C# /w asp.net using SQL... (which forum, lol) i have a dataset that i bind to a html datagrid, is there anyway i can manipulate the data in between the grab from the database, and the posting into the table? i just want to do some simple replaces... to replace some strings with images, etc... things i can't do with simple formatting... this is NOT for posting back to the db...
I feel your question is not clear enough to tell us your requirement. Can you explain it bit more detail? If I understand your requirement correctly, I feel you can use template columns in which you can have the images.
-
I feel your question is not clear enough to tell us your requirement. Can you explain it bit more detail? If I understand your requirement correctly, I feel you can use template columns in which you can have the images.
the data in the database in the columns i want to "interject" is signed integers.... i want negetive integers to have a upwards arrow (html img tag) replace the negative sign, and positive integers to have a downwards facing arrow in front of the number
-
the data in the database in the columns i want to "interject" is signed integers.... i want negetive integers to have a upwards arrow (html img tag) replace the negative sign, and positive integers to have a downwards facing arrow in front of the number
Hi, Sure can! Your easiest solution is probably to add a column to your DataTable and set an Expression on that column. Here's code snippet:
DataColumn DC=new DataColumn("strDisplay"); DS.Tables[0].Columns.Add (DC); DS.Tables[0].Columns["strDisplay"].Expression = "IIF(iIndex<0,'your downarrow html' + -1*iIndex,'your up arrow html'+iIndex)";
Check out the VS.NET help for DataColumn.Expression I am assuming 1) that you only have one DataTable in your DataSet 2) that the column of intergers on which you wish to operate is named "iIndex". Then you just display the content of the new column, "strDisplay", in your DataGrid. Hope this helps, Bill -
Hi, Sure can! Your easiest solution is probably to add a column to your DataTable and set an Expression on that column. Here's code snippet:
DataColumn DC=new DataColumn("strDisplay"); DS.Tables[0].Columns.Add (DC); DS.Tables[0].Columns["strDisplay"].Expression = "IIF(iIndex<0,'your downarrow html' + -1*iIndex,'your up arrow html'+iIndex)";
Check out the VS.NET help for DataColumn.Expression I am assuming 1) that you only have one DataTable in your DataSet 2) that the column of intergers on which you wish to operate is named "iIndex". Then you just display the content of the new column, "strDisplay", in your DataGrid. Hope this helps, Billthanks! works great!