By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,573 Members | 903 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,573 IT Pros & Developers. It's quick & easy.

DataGridView unbound cells loose content

P: n/a
Hi NG,

Why is it, that in my DataGridView all columns which are not bound to
a "DataProperty" loos thier content in a couple of occasions?

This happens if:
- Underlaying DataSet.AcceptChanges()
- DataGridView bound columns -Click on header for sorting

Is there a event, that I can use to detect this situation and then
"refill" my unbound DataGridViewColumns?

I this propably a bug in the DGV?

Thanks for Help and Hints
Rainer


Jul 4 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hi Rainer,

Thank you for posting.

When you display unbound columns along with the bound columns, this is
sometimes called "mixed mode". Because unbound columns are outside the data
source, they are ignored by the data source's sorting operations.
Therefore, when you enable sorting in mixed mode, you must manage the
unbound data in a local cache and implement virtual mode to let the
DataGridView control interact with it.

For more information on how to implement virtual mode, you may refert to
the example in the following link.

http://msdn2.microsoft.com/en-us/lib...22(d=ide).aspx
http://msdn2.microsoft.com/en-us/lib...datagridviewch
eckboxcolumn.threestate(d=ide).aspx

Hope this helps.
If you have anything unclear, please don't hesitate to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support

================================================== ==
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ==

Jul 5 '06 #2

P: n/a
Hello Linda,

thank you for responding.

"Linda Liu [MSFT]" <v-****@online.microsoft.comschrieb im Newsbeitrag
news:0y**************@TK2MSFTNGXA01.phx.gbl...
When you display unbound columns along with the bound columns, this is
sometimes called "mixed mode". Because unbound columns are outside the
data
source, they are ignored by the data source's sorting operations.
Therefore, when you enable sorting in mixed mode, you must manage the
unbound data in a local cache and implement virtual mode to let the
DataGridView control interact with it.
This sound logical.
Is it possible to disable sorting, to keep the content of my unbound colums?

For more information on how to implement virtual mode, you may refert to
the example in the following link.

http://msdn2.microsoft.com/en-us/lib...22(d=ide).aspx
http://msdn2.microsoft.com/en-us/lib...datagridviewch
eckboxcolumn.threestate(d=ide).aspx
I will have a look.

Regards
Rainer Queck
Jul 5 '06 #3

P: n/a
Hi Rainer,

Thank you for your quick response.

Yes, you could disable sorting by setting the SortMode property of the
columns in the DataGridView to NotSortable.
Sincerely,
Linda Liu
Microsoft Online Community Support

================================================== ==========================
=============================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

================================================== ==========================
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 5 '06 #4

P: n/a
Hi Linda,

thanks once more for your answert.
Yes, you could disable sorting by setting the SortMode property of the
columns in the DataGridView to NotSortable.
I decided to make use of the virtual mode, but I will keep that in mind.

Thanks
Rainer
Jul 5 '06 #5

P: n/a
Hi Rainer,

How is it going with implementing virtual mode in your program? If you have
any questions, please feel free to post in the newsgroup and we will follow
up.

Thank you for using our MSDN Managed Newsgroup Support Service!
Sincerely,
Linda Liu
Microsoft Online Community Support

================================================== ==========================
=============================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

================================================== ==========================
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 7 '06 #6

P: n/a
Hi Linda,

thanks for checking back on me.
I have now solve my DGV - unbound cell problems by using the virtual mode.
Works fine!

Regards
Rainer

"Linda Liu [MSFT]" <v-****@online.microsoft.comschrieb im Newsbeitrag
news:$6**************@TK2MSFTNGXA01.phx.gbl...
Hi Rainer,

How is it going with implementing virtual mode in your program? If you
have
any questions, please feel free to post in the newsgroup and we will
follow
up.

Thank you for using our MSDN Managed Newsgroup Support Service!
Sincerely,
Linda Liu
Microsoft Online Community Support

================================================== ==========================
=============================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

================================================== ==========================
=============================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 7 '06 #7

P: n/a
Hi Rainer,

Thank you for your update. I'm very glad to hear that you have solved the
problem.

If you have any other questions in the future, please don't hesitate to
contact us. It's always our pleasure to be of assistance.
Sincerely,
Linda Liu
Microsoft Online Community Support

================================================== ==========================
=============================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

================================================== ==========================
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 7 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.