c# - DataGridview, How to get some value from second level of an item and show it in a new column? -


I am using c # asp.net and building a windows application. I created a datagrid view and set up the data source. Everything is working fine.

But I would like to add a new column to my DataGridView and set some values. This value is not available at the first level, but the second level of the item

See the example below:

  Var searchResponse = Wait for the customer. Search Async (Search Parameters); & Lt; AuctionInfo & gt; DataSource = searchResponse.AuctionInfo; DataGridView1.DataSource = Data Source;  

Now I'd like to add the value "fullname" to a new column:

  foreach (var in auction search Search.resolution.AuctionInfo) {var item = wait client.GetItemAsync (Auction insights); String fullname = string Format ("{0} {1}", Item. First name, Item. Listname); }  

How can I apply it? If you set it "NewRowNeeded" you can put your value in the method:

P>

Another way to count the rows in the table is to call the event "dgv1.RowCount" ... If you save the value on this one variable, just add a +1 to the counter:

< P> Code

  int counter = dvg1.RowCount; Counter ++; Dvg1.rows [counter] .cell [0]. Value = "do some things here";  

You can call and set each cell as you edit the cells.

I hope this will help you! If this will not comment, and I will try to write some code for you. Be a good day


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -