This question is locked. New answers and comments are not allowed.
Hello, i'm using datagrid for windows 8 and i'm wondering how can i get the value of a certain cellule ?
For example a cell where it meets the cellule[5] and the row[1]
Help please
Thanks
For example a cell where it meets the cellule[5] and the row[1]
Help please
Thanks
3 Answers, 1 is accepted
0
Hi Zied,
Thank you for contacting us.
There are several methods/properties that could be useful:
- RadDataGrid.GetDataView() - gets the current view of the grid (with applied sorting, filtering, etc.)
- DataGridDataView.Items - collection of data items in the order they are displayed in the grid view.
- DataGridColumn.GetValueForInstance(element from the ItemsSource) - retrieves the column value for the provided object instance. If the column is of DataGridTemplateColumn type, then the instance itself is returned.
I have attached a sample application that demonstrates how you can use these to get a specific cell value.
I hope this was useful. Please, let us know if you have further questions.
Rositsa Topchiyska
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Zied
Top achievements
Rank 1
answered on 15 Jan 2014, 09:09 AM
Hello Rositsa,
sorry but yout code throws allways an exception telling me :
Index was out of range. Must be non-negative and less than the size of the collection.
and when i checked the gridview(var gridView = this.DataGrid.GetDataView(); ) variable i found that it counts "0" i don't know why!
any idea plzz?
Thanks :)
sorry but yout code throws allways an exception telling me :
Index was out of range. Must be non-negative and less than the size of the collection.
and when i checked the gridview(var gridView = this.DataGrid.GetDataView(); ) variable i found that it counts "0" i don't know why!
any idea plzz?
Thanks :)
0
Hi Zied,
Thank you for contacting us.
The grid view is ready to use after the RadDataGrud.DataBindingComplete event is raised, before that it's Items collection is empty. If this is not the case, could you please elaborate a bit more on the scenario where you get this exception, or send us a sample project.
I look forward to your reply.
Regards,
Rositsa Topchiyska
Telerik
Thank you for contacting us.
The grid view is ready to use after the RadDataGrud.DataBindingComplete event is raised, before that it's Items collection is empty. If this is not the case, could you please elaborate a bit more on the scenario where you get this exception, or send us a sample project.
I look forward to your reply.
Regards,
Rositsa Topchiyska
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.