Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Add cutom row to datagridview

$
0
0

HI,

I have a DGV bound to a Custom Binding Source (CBS)

The CBS has internally a Ilist of two kinds of rows: normal DataRowView (got from DataTable) and a Custom Rows (that I call GroupRoW) added programmatically 

When displaying the DGV I call its handle the RowPrePaint event. In the Handler of this event  I can check if a row is a normal DataRowView or a GroupRow

If it is a Groupow, I call a method to draw the row using Graphics.

All is oK

See the image (the gray rows are GroupRows)

Now I need to add in the Ilist of CBS a new type of row to in wich I have subTotal for each Group. (easy to build)

This new row type (that I will call SubTotalRow) should be graphically displayed on DGV as normal DataRowView; I mean with same columns 

Now the question is:  How to get the graphics from a DataRowView in order to show  SubTotalRow as a normal DataRowView(i.e. values in Columns) ?  .

In other words how can I clone DataGridView Graphics ?

The following image is the target of this question

Thanks For Help




Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>