Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF C#4.0
Hi,
Que 1) I have Multiple Radio Buttons in My WPF Application. I have Grouped each two radio button in one group using GroupName. On button click i want give the selected or checked radio button value to Database. Similarly I want to retrieve these value back from database on load.
 
Que 2) I have textbox in which i will enter certain value, depending on that value items added to datagrid should be restricted
for eg:-If I enter 5 in textbox then only 5 items or rows should be added
 
Help Me Out.
Thank You In Advance......
 

<UserControl xmlns:PrpGridCtrl="clr-namespace:PrpGridCtrl;assembly=PrpGridCtrl"  
             x:Class="PROPIPE_MAIN.Forms.frm_Oil_Fired_Boilers"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="650" Name="oilfrbio" Loaded="oilfrbio_Loaded">
            <Border BorderThickness="4" CornerRadius="4" Margin="0.5" BorderBrush="CadetBlue" removed="LightGray">
        <Grid>
            <Grid.Resources>
                <ControlTemplate x:Key="TextBoxErrorTemplate">
                    <StackPanel>
                        <Label Foreground="Red" Content="{Binding ElementName=Holder, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"/>
                    </StackPanel>
                </ControlTemplate>
            </Grid.Resources>
            <StackPanel Margin="0">
                <Grid Height="495">
 
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20,30,0,0" Height="25" Text="Economizer" TextAlignment="Right" Name="tx_Economizer"/>
                    <RadioButton Content="Yes" HorizontalAlignment="Left" Margin="180,30,0,0" VerticalAlignment="Top" Width="45" GroupName="Economizer" Name="rdbtn_EcoYes" TabIndex="0" IsChecked="True"/>
                    <RadioButton Content="No" HorizontalAlignment="Left" Margin="240,30,0,0" VerticalAlignment="Top" Width="45" GroupName="Economizer" Name="rdbtn_EcoNo" TabIndex="1"/>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20,50,0,0" Height="25" Text="De-Aerator" TextAlignment="Right" Name="tx_DeAerator"/>
                    <RadioButton Content="Yes" HorizontalAlignment="Left" Margin="180,50,0,0" VerticalAlignment="Top" Width="45" GroupName="De-Aerator" Name="rdbtn_DAetorYes" TabIndex="2" IsChecked="True"/>
                    <RadioButton Content="No" HorizontalAlignment="Left" Margin="240,50,0,0" VerticalAlignment="Top" Width="45" GroupName="De-Aerator" Name="rdbtn_DAetorNo" TabIndex="3"/>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="250,30,0,0" Height="25" Text="Gas Train" TextAlignment="Right" Name="tx_GasTrain"/>
                    <RadioButton Content="Yes" HorizontalAlignment="Left" Margin="400,30,0,0" VerticalAlignment="Top" Width="45" GroupName="GasTrain" Name="rdbtn_GasTrnYes" TabIndex="4" IsChecked="True"/>
                    <RadioButton Content="No" HorizontalAlignment="Left" Margin="460,30,0,0" VerticalAlignment="Top" Width="45" GroupName="GasTrain" Name="rdbtn_GasTrnNo" TabIndex="5"/>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="250,30,0,0" Height="25" Text="Scrubber" TextAlignment="Right" Name="tx_Scrubber"/>
                    <RadioButton Content="Yes" HorizontalAlignment="Left" Margin="400,30,0,0" VerticalAlignment="Top" Width="45" GroupName="GasTrain" Name="rdbtn_ScrYes" TabIndex="0" IsChecked="True"/>
                    <RadioButton Content="No" HorizontalAlignment="Left" Margin="460,30,0,0" VerticalAlignment="Top" Width="45" GroupName="GasTrain" Name="rdbtn_ScrNo" TabIndex="1"/>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="280,10,0,0" Height="25" Text="Type Of Boiler" TextAlignment="Right"/>
                    <RadioButton Content="Fire Tube" HorizontalAlignment="Left" Margin="430,10,0,0" VerticalAlignment="Top" GroupName="typeofboiler" Name="rd_FireTube"/>
                    <RadioButton Content="Water Tube" HorizontalAlignment="Left" Margin="520,10,0,0" VerticalAlignment="Top" GroupName="typeofboiler" Name="rd_WaterTube"/>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20,70,0,0" Height="25" Text="Number Of Boilers" TextAlignment="Right" Name="tx_NoOfBoilers"/>
                    
                    <PrpGridCtrl:PrpDataGrid  Height="212" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,276,0,0" Width="641" Name="DtGrd" 
                                              SelectionChanged="DtGrd_SelectionChanged" CellAdornerIsVisible="True" 
                                              AllowCheckAnyTime="True" IsVirtualizing="False" CellEditingIsEnabled="True" TabIndex="15">
                        <PrpGridCtrl:PrpDataGrid.Columns>
                            <PrpGridCtrl:PrpColumn CellContentIsClickable="True" Header="Tag Number" FieldName="tagnumber" Width="85" EditType="TextBox" IsSizable="False"/>
                            <PrpGridCtrl:PrpColumn CellContentIsClickable="True" Header="Capacity" FieldName="capacity" Width="95" EditType="TextBox" IsSizable="False"/>
                            <PrpGridCtrl:PrpColumn CellContentIsClickable="True" Header="Type Of Boiler" FieldName="typeboiler" Width="95" IsSizable="False"/>
                            <PrpGridCtrl:PrpColumn CellContentIsClickable="True" Header="Pressure Of Steam" FieldName="pressure" Width="120" EditType="TextBox" IsSizable="False"/>
                            <PrpGridCtrl:PrpColumn CellContentIsClickable="True" Header="Temperature Of Steam" FieldName="tempsteam" Width="135" EditType="TextBox" IsSizable="False"/>
                        </PrpGridCtrl:PrpDataGrid.Columns>
                    </PrpGridCtrl:PrpDataGrid>
                           
                        <Button Content="Add" HorizontalAlignment="Left" Margin="370,250,0,0" VerticalAlignment="Top" Width="75" TabIndex="12" FontFamily="Calibri" Name="btn_Add" Click="btn_Add_Click"/>
                        <Button Content="Delete" HorizontalAlignment="Left" Margin="460,250,0,0" VerticalAlignment="Top" Width="75" TabIndex="13" FontFamily="Calibri" Name="btn_Del" Click="btn_Del_Click"/>
                        <Button Content="Exit" HorizontalAlignment="Left" Margin="550,250,0,0" VerticalAlignment="Top" Width="75" TabIndex="14" FontFamily="Calibri" Name="btn_Exit" Click="btn_Exit_Click" />
                                     
                </Grid>
            </StackPanel>
        </Grid>
    </Border>
</UserControl>
 
Posted 31-Jan-13 23:45pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1


x:Class="PROPIPE_MAIN.Forms.frm_Oil_Fired_Boilers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlnsBig Grin | :-D ="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="650" Name="oilfrbio" Loaded="oilfrbio_Loaded">





<label foreground="Red" content="{Binding ElementName=Holder, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" />
























SelectionChanged="DtGrd_SelectionChanged" CellAdornerIsVisible="True"
AllowCheckAnyTime="True" IsVirtualizing="False" CellEditingIsEnabled="True" TabIndex="15">









<button content="Add" horizontalalignment="Left" margin="370,250,0,0" verticalalignment="Top" width="75" tabindex="12" fontfamily="Calibri" name="btn_Add" click="btn_Add_Click" />
<button content="Delete" horizontalalignment="Left" margin="460,250,0,0" verticalalignment="Top" width="75" tabindex="13" fontfamily="Calibri" name="btn_Del" click="btn_Del_Click" />
<button content="Exit" horizontalalignment="Left" margin="550,250,0,0" verticalalignment="Top" width="75" tabindex="14" fontfamily="Calibri" name="btn_Exit" click="btn_Exit_Click" />





  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2


x:Class="PROPIPE_MAIN.Forms.frm_Oil_Fired_Boilers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlnsBig Grin | :-D ="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="650" Name="oilfrbio" Loaded="oilfrbio_Loaded">

 
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100