Discussion:
Why are DataGridColumnStyle methods called multiple times ?
(too old to reply)
Rajesh Khater
2005-07-05 15:50:03 UTC
Permalink
hi ,

I have been studying customization of Datagrid columns by subclassing
DataGridColumnStyle. I have created a subclass of DataGridTextBoxColumn which
delegates all method calls to the base class.

But before delegating, it prints some debug statements to show when a
particular method is called by the framework.

The debug output shows that
SetDataGridInColumn is called twice for each column !

Also, whenever you end the editing of the current cell and move to a
different cell in the same row, the Commit method is called 2 times. If you
move to a different cell in a different row, the Commit method is called 3
times !

What is the rationale behind all these ? Isnt the DataGrid highly
un-optimized ? So many methods of the attached DataGridColumnStyle objects
are called multiple times .. looks redundant apparently.

Thanks,
Rajesh.
Lampu Lampan ()
2005-07-19 05:34:34 UTC
Permalink
Hi all,
The question asked by Rajesh is really of great importance especially for those creating their own DataGridColumnStyles. I have searched a lot n lot and failed. Anybody there having any idea, please?

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Jian Yang
2005-09-16 18:57:15 UTC
Permalink
Hi There,

I got the same problem and cannot figure out WHY. Looks like one more of
those questions for which there will be no answers and we'll have to find a
workaround. For this purpose, I noticed three things: 1) If the content of
the cell is modified, then Commit is called only once, otherwise, it's called
twice or three times. 2) It doesn't seem to have anything to do with Edit
method in the base: even if I put a "return;" at the beginning of all my Edit
methods, Commit is called the same way. 3) BoolColumn has the same behavior
with TextBoxColumn. Any more observations that might lead to a
pseudo-explanation?

Jian Yang
Post by Lampu Lampan ()
Hi all,
The question asked by Rajesh is really of great importance especially for those creating their own DataGridColumnStyles. I have searched a lot n lot and failed. Anybody there having any idea, please?
**********************************************************************
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Loading...