Need help with DataSet

L

Ljoha

I have webapp where I am getting data from webservice. To show this
data I am using DataSet and DataGrid. Here I have two columns and I
would like to change value in "hour" column (value in this column
always same). Ex: if I have 0 - I would like to change it to "00:00".
How I can do that?


My data from webservice:
......
xmlns:diffgr="urn:schemas-micr­osoft-com:xml-diffgram-v1">
- <NewDataSet xmlns="">
- <Table diffgr:id="Table1" msdata:rowOrder="0">
<hour>0</hour>
<count>9</count>
</Table>
- <Table diffgr:id="Table2" msdata:rowOrder="1">
<hour>1</hour>
<count>7</count>
</Table>
- <Table diffgr:id="Table3" msdata:rowOrder="2">
<hour>2</hour>
<count>7</count>
</Table>
......


C#:
.....
dg.Columns.Add(hour);
dg.Columns.Add(count);
dg.DataSource=ds;
dg.DataMember="Table";
dg.DataBind();
.....
 
P

perspolis

you can define TableStyle for your datagrid and in intableStyle define a
DataGridTextBoxColumn..
this class has a property name format and you can define a specified format
for that to show your data.
I have webapp where I am getting data from webservice. To show this
data I am using DataSet and DataGrid. Here I have two columns and I
would like to change value in "hour" column (value in this column
always same). Ex: if I have 0 - I would like to change it to "00:00".
How I can do that?


My data from webservice:
......
xmlns:diffgr="urn:schemas-micr­osoft-com:xml-diffgram-v1">
- <NewDataSet xmlns="">
- <Table diffgr:id="Table1" msdata:rowOrder="0">
<hour>0</hour>
<count>9</count>
</Table>
- <Table diffgr:id="Table2" msdata:rowOrder="1">
<hour>1</hour>
<count>7</count>
</Table>
- <Table diffgr:id="Table3" msdata:rowOrder="2">
<hour>2</hour>
<count>7</count>
</Table>
......


C#:
.....
dg.Columns.Add(hour);
dg.Columns.Add(count);
dg.DataSource=ds;
dg.DataMember="Table";
dg.DataBind();
.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top