Hi,
There is a column in a table of dataset, that can have only 2 values(Yes, No).
In the Xamdatagrid, there has to be a column with 2 radio buttons which have to be made selected, based upon the data which is there in the dataset.
Could anybody help me out how to achieve this.. Thanks!!
Hello,
Basically, you need to create a custom template for the CellValuePresenter with two radio buttons and bind the value to them. Please follow the following forum thread for a similar solution:
http://community.infragistics.com/forums/p/29876/150808.aspx#150808
Hope this helps.
Thanks for d reply Alex.
The sample proj which u gave doesnt allow me to attach a custom data source as the xaml internally creates one(cos of nested tags).
could u give me a sample which wud allow me to do so??
There are couple of ways to bind the XamDataGrid.
1. Set the DataSource property
2. Add items directly in the DataItems collection.
Both 1 and 2 are self excluding - you can set one or the other.
In your case, you are probably adding items directly between the opening and closing tag of the XamDataGrid and setting the DataSource in code behind. If you want to add them in the xaml, remove the data source property in the code behind (or in the xaml). If that still does not solve the problem, please send us a code snippet with your XamDataGrid and how you are trying to bind it in the xaml or a sample application with the problem so that we can look into it.
While trying to bind data, i got this error - "cant set datasource on a datatpresenter that has items added explicitly thrua data items collection".
I am not adding any data items in my code behind, which means its in xaml.
After a bit if srching i found out that as the xaml internally creates a datasrc, so its not possible to bind it again thru the code behind??
Could you please elucidate
I am not sure what the problem is. You can set your data source through the DataSource property of the XamDataGrid. The nested tags are the FieldLayout definitions.
What you need to do is change the DataSource property, which is set in the code behind with your custom data source and change the FieldLayout according to your custom data source.