This is a migrated thread and some comments may be shown as answers.

textbox values cleared when clicked on Rowdetail

0 Answers 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vinay
Top achievements
Rank 1
Vinay asked on 29 Dec 2011, 01:46 PM
Hi,
I am facing a weird issue in GridView.
When i input some value to textbox or any control inside a GridViewColumn.CellTemplate and the click on togglebutton or scrollbar of the grid. The value inside the textbox is cleared automatically.

Below is my code,
<telerik:RadGridView x:Name="dgIncidentTrackingReportSection" Visibility="Collapsed" IsFilteringAllowed="False" AutoGenerateColumns="False" BorderThickness="2" HorizontalAlignment="Stretch" CanUserReorderColumns="False" ShowGroupPanel="False" CanUserResizeColumns="False" CanUserDeleteRows="False" CanUserSelect="True" CanUserInsertRows="False" Margin="10,40,10,0" Grid.Row="4" RowIndicatorVisibility="Collapsed" Grid.ColumnSpan="2">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewToggleRowDetailsColumn />
 
                            <telerik:GridViewDataColumn Header="Rec. ID" IsReadOnly="True" DataMemberBinding="{Binding UserAccessID}" />
                            <telerik:GridViewDataColumn Header="Patient Name" IsReadOnly="True" DataMemberBinding="{Binding PatientName}" />
                            <telerik:GridViewDataColumn Header="MR #" IsReadOnly="True" DataMemberBinding="{Binding MedRecNumber}" />
                            <telerik:GridViewDataColumn Header="Account #" IsReadOnly="True" DataMemberBinding="{Binding AccountNumber}" />
                            <telerik:GridViewDataColumn Header="Patient Loc." IsReadOnly="True" DataMemberBinding="{Binding PatientLocation}" />
                            <telerik:GridViewDataColumn Header="User ID" IsReadOnly="True" DataMemberBinding="{Binding UserID}" />
                            <telerik:GridViewDataColumn Header="User Name" IsReadOnly="True" DataMemberBinding="{Binding UserName}" />
 
                            <telerik:GridViewColumn Header="User Facility">
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock Text="{Binding TxtFacility}" Visibility="{Binding TxtFacilityvisibility}"></TextBlock>
 
                                            <telerik:RadComboBox ItemsSource="{Binding Facility}" x:Name="cmbFacility" SelectionChanged="cmbFacility_SelectionChanged" MaxDropDownHeight="100" Visibility="{Binding CmbFacilityvisibility}"></telerik:RadComboBox>
                                        </Grid>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewColumn>
 
 
                            <telerik:GridViewDataColumn Header="User Department" IsReadOnly="True" DataMemberBinding="{Binding UserDepartment}" />
                            <telerik:GridViewDataColumn Header="User Department.#">
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock Text="{Binding TxtDepartmentNo}" Visibility="{Binding TxtDepartmentNovisibility}"></TextBlock>
 
                                            <TextBox x:Name="TextboxDepartmentNumber" Height="25" Text="{Binding DepartmentNo}" Visibility="{Binding TxtboxDepartmentNovisibility}" />
                                        </Grid>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
 
 
                            <telerik:GridViewColumn Header="Relationship">
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock Text="{Binding TxtRelationship}" Visibility="{Binding TxtRelationshipvisibility}"></TextBlock>
 
                                            <telerik:RadComboBox ItemsSource="{Binding RelationToPatient,Mode=TwoWay}" x:Name="cmbRelationShip" SelectionChanged="cmbRelationShip_SelectionChanged" MaxDropDownHeight="100" Visibility="{Binding CmbRelationshipvisibility}"></telerik:RadComboBox>
                                        </Grid>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewColumn>
 
                            <telerik:GridViewDataColumn Header="PHI Source" IsReadOnly="True" DataMemberBinding="{Binding Source}" />
 
 
                            <telerik:GridViewColumn Header="Action Taken">
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock Text="{Binding TxtActionTaken}" Visibility="{Binding TxtActionTakenvisibility}"></TextBlock>
 
                                            <telerik:RadComboBox ItemsSource="{Binding ActionTaken}" x:Name="cmbActionTaken" SelectionChanged="cmbActionTaken_SelectionChanged" MaxDropDownHeight="100" Visibility="{Binding CmbActionTakenvisibility}"></telerik:RadComboBox>
                                        </Grid>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewColumn>
 
                            <telerik:GridViewColumn Header="Action Date">
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock Text="{Binding TxtActionDate}" Visibility="{Binding TxtActionDatevisibility}"></TextBlock>
 
                                            <telerik:RadDatePicker x:Name="DatePickerActionDate" Height="25" SelectedDate="{Binding Date,Mode=TwoWay}" Visibility="{Binding DtActionDatevisibility}" />
                                        </Grid>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewColumn>
 
                            <telerik:GridViewColumn Header="Director">
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock Text="{Binding TxtDirector}" Visibility="{Binding TxtDirectorvisibility}"></TextBlock>
 
                                            <TextBox x:Name="TextboxDirector" Height="25" Text="{Binding Director,Mode=TwoWay}" Visibility="{Binding TxtboxDirectorvisibility}" />
                                        </Grid>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewColumn>
 
                            <telerik:GridViewColumn Header="Director.#">
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <TextBlock Text="{Binding TxtDirectorNo}" Visibility="{Binding TxtDirectorNovisibility}"></TextBlock>
 
                                            <TextBox x:Name="TextboxDirectorNumber" Height="25" Text="{Binding DirectorNo}" Visibility="{Binding TxtboxDirectorNovisibility}" />
                                        </Grid>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewColumn>
 
                        </telerik:RadGridView.Columns>
                        <telerik:RadGridView.RowDetailsTemplate>
                            <DataTemplate>
                                <StackPanel x:Name="Test" Height="200">
                                </StackPanel>
                            </DataTemplate>
                        </telerik:RadGridView.RowDetailsTemplate>
                    </telerik:RadGridView>
Whenever rowdetail is clicked the Textbox,Combobox,Datapicker selected values are cleared.
Tags
GridView
Asked by
Vinay
Top achievements
Rank 1
Share this question
or