Issue with stored object viewing on datatable and gridview
See original GitHub issueMy program displayed an unexpected result on gridview: I want to show all fields of the key value, so please help me. My object:
public class Id
{
public string CallTime { set; get; }
public string CallerID { set; get; }
public string Destination { set; get; }
}
class Report
{
[BsonId]
public Id key { set; get; }
public string Status { set; get; }
.
.
}
Stored
var reports = db.GetCollection<Report>("reports");
foreach (Report rp in lsRe)
reports.Insert(rp);
Query
var col = db.GetCollection<Report>("reports");
col.Include(x=>x.key.CallTime)
.Include(x => x.key.CallerID)
.Include(x => x.key.Destination)
.FindAll());
Sorry for my bad English, thank you.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
DataTable to GridView did not display the resulting table
I tried debugging and verified that data are being stored into the DataTable correctly. There is no code on the aspx side, just...
Read more >Solved: DataTable is showing [object Object] in column for...
Solved: Hi, I have created small App that pulls data from sharepoint list. Form has Datatable and Formviewer to display rows selected in...
Read more >Insert row into the GridView and not adding the data - MSDN
I store the DataTable in the ViewState so that its contents are not lost, and so I can rebind the DataTable to the...
Read more >ASPxGridView batch editable column doesn't allow to save ...
Hi, I have an editable Gridview which it's datasource comes from a Datatable I obtain from a sql query. I need to edit...
Read more >Devexpress gridview get row values. DataTable or System. cre
This method will return an object that represents your data source item. Sorted by: 3. ... GetRowValues and some others (see the ASPxGridView...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bolner I’m honestly not sure anymore if the screenshot that is being showed is LiteDB Studio or another self-made program. @anh309 Can you confirm?
@anh309 In any case, you don’t need to do the includes as those are only required when you’re using BsonRefs. What you might want to do is a select after the fetching that projects the data in the format that you want it to be (or override the ToString() method of the class Id, like @bolner already suggested)