datagrid colum's nulltext property displayed in column when field not null

  • Thread starter Thread starter TS
  • Start date Start date
T

TS

I have a record displayed in datagrid and 2 columns says the text i've
designated as the nulltext for those columns, but when i look at the data in
the db, those values are listed there.

is there some issue/bug that can be causing this?

thanks
 
Hi TS,

Thanks for your post!!

For this issue, do you fill the database table into .Net DataSet/DataTable
object, then bind the DataSet/DataTable to the DataGrid? If so, I suggest
you look into the underlying datasource(DataTable) to see the corresponding
DataColumn's values, are they Null reference data? Also, for these 2
nulltext DataGridColumnStyle, have you correctly set their MappingName
property to corresponding DataColumn name?

Actually, currently with your post information, we still can not reproduce
out the problem. Can you show us some more information and some sample code
snippet for us to reproduce out this issue? Then we can understand the
issue better, and help you better. I will wait for your further feedback.
Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
This is a bug that happens randomly and that i've never been in debug mode
when it happened so i couldn't inspect the dataview, though i did check the
resultset that was created from the stored procedure that this dataview
uses, and there was a value for this column, so it seems its either a bug in
the datagrid or the dataview, though i cannot recreate either. I am
including the relevant code, but theres not really anything to go on, so if
you have any ideas on any possible reasons, let me know, else have a nice
day!

dsMonitorTI = monitorTests.MaintainTestInstance(sFilter);

dvMonitorTests = new DataView(dsMonitorTI.Tables[0]);

dvMonitorTests.AllowDelete = false;

dvMonitorTests.AllowEdit = false;

dvMonitorTests.AllowNew = false;

dgMonitoring.DataSource = dvMonitorTests;

dataTableCurrencyManager =
(CurrencyManager)this.dgMonitoring.BindingContext[dvMonitorTests];



dgMonitoring.Refresh();
 
Hi TS,

Thanks for your post!!

Based on your feedback, it seems that the problem only occurs at release
mode, yes? Also, based on your checking, there are "real" values in
DataColumn in source DataTable, but the DataGrid still displays NullText.

Currently, with your little code snippet, we still can not reproduce out
your problem(Actually, I have used DataGrid for many many times, but did
not meet this specific issue). There are severl suggestion for this issue:
#1, Create a new project, then paste your original code in this new
project, does the problem occur in new project? (So we can determine if
this issue is project specific)
#2, Move your project in your colleague's machine, does this problem occurs
either?(So we can determine if this issue is machine specific)
#3, Get rid of the database dependency, just use code to construct a valid
datatable as datasource, can this problem be reproduced out?
#4, If this issue is not machine specific or project specific, which can be
reproduced always, I suggest you create a sample project, then attach it in
the newsgroup, I will refer to it and did some for it.

Once, I can reproduce out the problem in my side, I understand the problem
better. Thanks
===============================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top