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

Get the button

4 Answers 52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bennet
Top achievements
Rank 1
Bennet asked on 29 Sep 2010, 11:21 AM
<telerik:RadGridView x:Name="grdList" ItemsSource="{Binding }"
      <telerik:RadGridView.Columns
            <telerik:GridViewDataColumn Header="角色代码" DataMemberBinding="{Binding Code}"/> 
            <telerik:GridViewDataColumn Header="角色名称" DataMemberBinding="{Binding Name}"/> 
            <telerik:GridViewDataColumn Header="最后编辑人员" DataMemberBinding="{Binding LastEditBy}"/> 
            <telerik:GridViewDataColumn Header="最后编辑时间" DataMemberBinding="{Binding LastEditDate}"/> 
            <telerik:GridViewCheckBoxColumn Header="是否禁用" DataMemberBinding="{Binding Disable}"/> 
            <telerik:GridViewColumn Header="操作"
                <telerik:GridViewColumn.CellTemplate
                    <DataTemplate
                        <telerik:RadButton Content="设置成员" x:Name="btn" CommandParameter="{Binding Code}" Click="RadButton_Click" Height="25" Margin="3"/> 
                    </DataTemplate
                 </telerik:GridViewColumn.CellTemplate
              </telerik:GridViewColumn
          </telerik:RadGridView.Columns
</telerik:RadGridView>
How can I get the button?

4 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 29 Sep 2010, 11:34 AM
Hello Bennet,


There is an extension method in Telerik.Windows.Controls namespace -
You may use something like Cell.ChildrenOfType<RadButton>()

However if you specify some more details on what are you trying to achieve and where/when do you need a reference to the button , I can provide some additional assistance.

Sincerely yours,
Pavel Pavlov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Bennet
Top achievements
Rank 1
answered on 30 Sep 2010, 01:13 AM
Do you have an example?Thank you!
0
Accepted
Maya
Telerik team
answered on 30 Sep 2010, 08:10 AM
Hello Bennet,

I am sending you a sample project illustrating the implementation of both extension methods - ChilrednOfType<> and ParentOfType<>.You may find additional information about them in this blog post.

 

All the best,
Maya
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Bennet
Top achievements
Rank 1
answered on 03 Oct 2010, 08:19 AM
Thank you very much!
Tags
GridView
Asked by
Bennet
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Bennet
Top achievements
Rank 1
Maya
Telerik team
Share this question
or