I did set the AutoGeneratedColumns to false so I can set the columns myself. Here's my code :
rgvJobs.IsReadOnly = true;
rgvJobs.AutoGenerateColumns =
false;
rgvJobs.Columns.Add(new Telerik.Windows.Controls.GridViewColumn() { Header = "Job ID", Width = 50, IsReadOnly = true });
rgvJobs.Columns.Add(new Telerik.Windows.Controls.GridViewColumn() { Header = "Job Date", Width = 120, IsReadOnly = true });
rgvJobs.Columns.Add(new Telerik.Windows.Controls.GridViewColumn() { Header = "Job Status", Width = 50, IsReadOnly = true });
rgvJobs.ItemsSource = _Jobs;
However, the grid shows the right number of rows but all the cells are empty. Any toughts ?
However, the grid shows the right number of rows but all the cells are empty. Any toughts ?
9 Answers, 1 is accepted
You may need to set DataMemberBinding for these columns.
Sincerely yours,Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Can you verify if you have all needed references: Telerik.Windows.Controls.dll, Telerik.Windows.Data.dll, Telerik.Windows.Controls.Input.dll and Telerik.Windows.Controls.GridView.dll?
Please post also more info about your grid version.Sincerely yours,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
The version is your demo I just downloaded from your site
2009.3.1103.1030
Thank you
Indeed you can do all these however I'm not sure why you don't see simple things like DataMemberBinding. Can you send us an example where this can be reproduced?
Sincerely yours,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Repro Project
Let me know...
Generally DataMemberBinding is available on GridViewDataColumn - GridViewColumn is unbound. Sorry I've missed this in my first reply.
Regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Great. With your help I've been able to mount the right line.
Here it is :
rgvJobs.Columns.Add(
new Telerik.Windows.Controls.GridViewDataColumn() { Header = "Job ID", Width = 80, IsReadOnly = true, DataMemberBinding = new System.Windows.Data.Binding("JobId") });
So the bottom line is that you need to use the GridViewDataColumn for the Add and I was using GridViewColumn which was my mistake.
Thank you
