Hi Infragastics Team,
I am trying to have set of radio buttons inside a xamdatagrid. But the problem is that I am binding xamdatagrid to Dataset. I did not find much resources.
I am attaching my sample example(which has checkbox, Not Radio Button). Please specify how can i add the Radio Button in the xamdatagrid. Also How to have space between two tables in the xamdatagrid, Since my Dataset may have upto 10 tables.
Thanks AKshayC#.zip
Hello Akshay,
Thank you for contacting Infragistics!
To get radio buttons in the XamDataGrid you would have to have a template field:
https://www.infragistics.com/help/wpf/xamdatagrid-configuring-template-field
What are you trying to achieve with the radio buttons?What is the behavior you are expecting?
Sincerely,Mike P.Software DeveloperInfragistics, Inc.www.infragistics.com
HI mike,
Thanks for the reply.
I have attached a Project which displays set of tables with checkboxes in each row. I want to replace the checkboxes with radio button.
When user clicks the MASS UPDATE and ACTIVATE button, I want to capture the row which the user has checked the radio button and wants to send the data to Database.
Mike, it will be helpfull if you modify the my attached project, TestProject.zip
Thank you for the update. For further clarification do you want the radio buttons in the rows to act as 1 group where you can only select one row? Or do you just want a checkbox that has a difference appearance and the user can select as many rows/radio buttons as they want?
Hi Mike,
i want Radio button in the rows to act as 1 group in the first table, Similarly i also want this for second table.
Basically,
If there are two tables.
First table has 4 Rows(radio Button), Then user should be able to select only one row(radio button) from 4 rows(Radio Button).
Second Table has 3 Rows (radio Button), Then user should be able to select only one row(radio button) from 3 rows(Radio Button).
At the End, one Row from each table.
It would be very helpfull, If i get this in MVVM.
Thanks
Akshay
Thank you for the update. As mentioned previously you would have to template the column and put the radio button in there. In addition to that you will be responsible for unselecting and previous radio buttons when you select a new radio button as each cell would be its own radio button group. You can look into the selected items changed event for going through your other rows and unselecting the radio button:
https://www.infragistics.com/help/wpf/infragisticswpf.datapresenter~infragistics.windows.datapresenter.datapresenterbase~selecteditemschanged_ev
Okay thanks
I was able to get Radio Button in XamDataGrid.
Here are the code changes:-
Radio Button style in the resource section.
<Style x:Key="RadioButtonInXamDataGrid" TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <Border BorderThickness="0,0,1,0" BorderBrush="{TemplateBinding BorderBrush}" > <RadioButton IsChecked="{Binding Path=DataItem.SELECT_VERSION}" HorizontalAlignment="Center" VerticalAlignment="Center" GroupName="{Binding Path=DataItem.Group}"> </RadioButton> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>
Xamdatagrid : Filed type
<igDP:Field Name="SELECT_VERSION"> <igDP:Field.Settings> <igDP:FieldSettings CellValuePresenterStyle="{StaticResource RadioButtonInXamDataGrid}" AllowEdit="True" /> </igDP:Field.Settings> </igDP:Field>
I have one question, How to increase spacing between two Tables, I am binding xamdatagrid to a Dataset which has multiple tables, How to increase spacing between the two tables.
Hello,
Concerning spacing between tables I recommend you look at the following:
https://www.infragistics.com/community/forums/f/ultimate-ui-for-wpf/33319/how-to-control-spacing-between-tables
https://www.infragistics.com/community/forums/f/ultimate-ui-for-wpf/29045/how-to-control-spacing-between-tables