Hi there,
I know there's no RowDataBound event for the WinForms DataGridView. But there is CellFormatting event in WinForms DataGridView. So Cellformatting event is very very slow.
Is there any solutions like RowDataBound event in WinForms DataGridView (Other then Cellformatting) ?
Thanks for all.
WinForms DataGridView RowDataBound
Page 1 of 16 Replies - 11971 Views - Last Post: 14 June 2010 - 12:43 AM
Replies To: WinForms DataGridView RowDataBound
#2
Re: WinForms DataGridView RowDataBound
Posted 26 May 2010 - 10:05 AM
What exactly are you trying to do... It's possible that there might be some better solution to your problem than using CellFormating event...
#3 Guest_Jortx*
Re: WinForms DataGridView RowDataBound
Posted 11 June 2010 - 02:28 AM
FlashM, on 26 May 2010 - 09:05 AM, said:
What exactly are you trying to do... It's possible that there might be some better solution to your problem than using CellFormating event...
¿Can you post this better solution you say?
He should be trying something like set the value of a new column:
GridView1.Rows(i).Cells("Total") = GridView1.Rows(i).Cells("Units") * GridView1.Rows(i).Cells("Price")
So, i say CellFormatting is not the best solution.
For example, CellFormatting fires when you click on the Grid... This is no like RowDataBound, sure.
¿Any help?
Thanks a lot.
#4
Re: WinForms DataGridView RowDataBound
Posted 11 June 2010 - 04:47 AM
Sadly, there is no optimal way to do a RowDataBound for the DataGridView in WinForms. All of them are slow.
Your other option is to use the DataBindingComplete event for the grid, then loop through all the rows and change the cell data. It's not optimal, but if you have only a few rows(less than 50), then you won't see any slowdown.
Your other option is to use the DataBindingComplete event for the grid, then loop through all the rows and change the cell data. It's not optimal, but if you have only a few rows(less than 50), then you won't see any slowdown.
This post has been edited by eclipsed4utoo: 11 June 2010 - 04:51 AM
#5 Guest_Jortx*
Re: WinForms DataGridView RowDataBound
Posted 11 June 2010 - 08:42 AM
eclipsed4utoo, on 11 June 2010 - 03:47 AM, said:
Sadly, there is no optimal way to do a RowDataBound for the DataGridView in WinForms. All of them are slow.
Your other option is to use the DataBindingComplete event for the grid, then loop through all the rows and change the cell data. It's not optimal, but if you have only a few rows(less than 50), then you won't see any slowdown.
Your other option is to use the DataBindingComplete event for the grid, then loop through all the rows and change the cell data. It's not optimal, but if you have only a few rows(less than 50), then you won't see any slowdown.
Thanks man,.
Sure, you can do that, but is very different than use a wonderful event like RowDataBound.
Exactly what i need, is to show the typical summary row at the bottom of the GridView, but i'm finding some posts in other forums that is not easy! I'm very surprised about it. There's not an easy way to show a summary row in the gridview?
#6
Re: WinForms DataGridView RowDataBound
Posted 11 June 2010 - 08:53 AM
Easy way? not that I know of. It would be great if the RowDataBound event existed in WinForms, but it doesn't.
#7 Guest_Jortx*
Re: WinForms DataGridView RowDataBound
Posted 14 June 2010 - 12:43 AM
Wow... Normally, the things you want to do for WinForms are easier than to do it for WebForms.
This is not the case...
At the moment, I do all the things I need in the datasource, and then, to calculate the summary, y do it iterating each datagrid row. I don't like it, because when the grid have too many rows, sure this will be a slow method.
Thanks for all your replies.
Regards.
This is not the case...
At the moment, I do all the things I need in the datasource, and then, to calculate the summary, y do it iterating each datagrid row. I don't like it, because when the grid have too many rows, sure this will be a slow method.
Thanks for all your replies.
Regards.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|