Hi there.
I worked around using something like this:
ds = srv.GetData(); // the Web Method of my Web Service
dgv.AutoGenerateColumns = false;
dgv.DataSource = ds.Tables[0];
DataGridViewTextBoxColumn TextBoxColumn1 = new
DataGridViewTextBoxColumn();
TextBoxColumn1.HeaderText = "Id";
TextBoxColumn1.Width = 60;
TextBoxColumn1.DataPropertyName = "id";
DataGridViewCheckBoxColumn CheckBoxColumn = new
DataGridViewCheckBoxColumn();
CheckBoxColumn.HeaderText = "Descrição";
CheckBoxColumn.DataPropertyName = "estado";
dgv.Columns.Add(TextBoxColumn1);
dgv.Columns.Add(CheckBoxColumn);
It works!
Now, I'm having another problem. How can I uptade data via WS again?
If I used DataAdapter/DataSet, I would be easier. But, in this case, I will
use a Web Service to update data on database - something like, when I click
an update button, it will execute:
srv.UpdateData(data); // srv - my Web Service
How can I get the data that I edited in DataGridView and update database via
WS?
Thanks again.
Ragards.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comescreveu
na mensagem news:Oa**************@TK2MSFTNGP04.phx.gbl...
Marco,
Can you create a typed instance of the data set in your code which is
the same as what the server returns (when you created the reference for
your proxy, it should have created some sort of type which exposes these
properties properly).
Using that, you should be able to bind to ^that^ and then configure
your grid properly.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Marco Pais" <marco.pais[at]gmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Hi there.
I have a DataGridView on a desktop application and it's being filled
through the use of a Web Service, wich returns a DataSet. The I use
datagrid.DataSource=mydataset.tables[0] to bind the data.
This dataset contains a table with 4 columns: id, description, status,
private. Column status can take 4 values, and private, 2 values.
My question is: how can I make the column status a
DataGridViewComboBoxColumn and column private a
DataGridViewCheckBoxColumn?
I know that, at design time, I can add ComboBox and CheckBox columns, but
how can I mapp those columns with the data returned by the DataSet,
trough the web Service?
Thanks in advance.
Regards.
Marco