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

RadGridView

8 Answers 157 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 1
Avinash asked on 25 Aug 2015, 11:18 AM
Hi ..how to acsess the control  like textbox, label inside the radgridview  by clicking the button outside

8 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 25 Aug 2015, 04:21 PM
Hello,

You can find it by traversing the visual tree with the WPF VisualTreeHelper, or with our extension method ChildrenOfType<FrameworkElement> (which is acually much easier to use). Can you please share which would be the ultimate goal of this activity? Generally, setting visual properties, or executing custom event logic for the cell elements is not recommended, as this can cause unexpected results when the UI virtualization logic is enabled.

Regards,
Ivan Ivanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 26 Aug 2015, 05:32 AM

hi ..  i have xaml code like this  ..i want to acsess textbox dropdownllist id  by clicking the save button..  i kept button outside the grid please see the code and help me

 

 

 <telerik:RadGridView  Name="LookUpMaster" GotFocus="LookUpMaster_GotFocus"
                                            Grid.Row="0" Style="{DynamicResource GridStyle}" IsReadOnly="False" AutoGenerateColumns="False" CanUserInsertRows="True" NewRowPosition="Top"
                                             AddingNewDataItem="LookUpMaster_AddingNewDataItem"
                                           CellValidating="LookUpMaster_CellValidating"
                                              EditTriggers="CellClick"
                                              SelectionChanging="LookUpMaster_SelectionChanging">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn Header="Refrence Code" DataMemberBinding="{Binding CommonRefcd}" UniqueName="CommonRefcd">
                                    <telerik:GridViewDataColumn.CellEditTemplate >
                                        <DataTemplate>
                                            <TextBox  x:Name="RefCodeTextBox"   LostFocus="RefCodeTextBox_LostFocus" IsReadOnly="True" Text="{Binding CommonRefcd}" />
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellEditTemplate>


                                </telerik:GridViewDataColumn>
                                <telerik:GridViewDataColumn Header="Refrence Name" DataMemberBinding="{Binding CommonRefNm}"  UniqueName="CommonRefNm"  >
                                    <telerik:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>

                                            <TextBox x:Name="RefNameTextBox" Text="{Binding CommonRefNm}" LostFocus="RefNameTextBox_LostFocus"/>

                                          
                                        </DataTemplate>

                                    </telerik:GridViewDataColumn.CellEditTemplate>
                                </telerik:GridViewDataColumn>
                                <telerik:GridViewDataColumn Header="Refrence Description" UniqueName="CommonRefDs"  DataMemberBinding="{Binding CommonRefDs}" >
                                    <telerik:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>

                                            <TextBox x:Name="RefDsTextBox"  GotFocus="RefDsTextBox_GotFocus"  LostFocus="RefDsTextBox_LostFocus"/>
                                        </DataTemplate>

                                    </telerik:GridViewDataColumn.CellEditTemplate>
                                </telerik:GridViewDataColumn>
                                <telerik:GridViewDataColumn Header="Refrence Category" 
                                    DataMemberBinding="{Binding CommonRefCategory}">
                                    <telerik:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>
                                            <SMS:AutoCompleteBox x:Name="CategoryTextBox" GotFocus="CategoryTextBox_GotFocus"  LostFocus="CategoryTextBox_LostFocus" QueryName="GetCategory"/>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellEditTemplate>
                                </telerik:GridViewDataColumn>

                                <telerik:GridViewDataColumn Header="Status" DataMemberBinding="{Binding Status}">
                                    <telerik:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>
                                            <SMS:AutoCompleteBox x:Name="StatusTextBox" 
                                         LostFocus="StatusTextBox_LostFocus" GotFocus="StatusTextBox_GotFocus" QueryName="GetStatus"/>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellEditTemplate>
                                </telerik:GridViewDataColumn>
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>​

0
Avinash
Top achievements
Rank 1
answered on 26 Aug 2015, 05:36 AM
hi ..one more help  i need how to validate the  textbox control inside the radgridview with regural expression
0
Avinash
Top achievements
Rank 1
answered on 26 Aug 2015, 05:56 AM

Hi...I have One More problem in Radgridview   Actually When am going to add new item by clicking the add new (+) Button  First I enterd some data to first cloumn than am going enter data to second column at  this time first column data is not visible like that  3rd & 4th also..but data is saved in db...i want see all the column wat i entered untill click the save button..plz help me as soon as possible

 

0
Avinash
Top achievements
Rank 1
answered on 26 Aug 2015, 06:01 AM
Hi ...inside the radgridview  i bind some data to textbox from db when am clickingn the cell data is not visible  i kept textbox control inside the CellEditTemplate .. i want to see that data when am clicking the cell  pls help me
0
Avinash
Top achievements
Rank 1
answered on 26 Aug 2015, 09:10 AM
hi.. what is equivqlent event of itemdatabound in wpf grid
0
Avinash
Top achievements
Rank 1
answered on 27 Aug 2015, 06:09 AM
Hi ..how to refresh the xaml page using vb.net
0
Ivan Ivanov
Telerik team
answered on 27 Aug 2015, 02:49 PM
Hi,

I will try to address the listed inquiries in their original order. If you need any additional help, related to our controls, in the future, I would ask you to open a separate thread for every new question.
  1. Looking through the provided XAML snippet, I am not sure which element do you want to access. However, you can always use our method ChildrenOfType<FrameworkElement> (that I mentioned in my first post) and find it by name.
  2. You can use the RegularExpression attribute, to validate the input in the model.
  3. You have an empty editor, as soon as you start editing, am I right? Can you please verify that the TextBox is properly bound? You can also check for binding expression path errors in the output window.
  4. You can try the DataLoaded event.

Regards,
Ivan Ivanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Avinash
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Avinash
Top achievements
Rank 1
Share this question
or