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

Buttons in a radGridView

2 Answers 100 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Antoine
Top achievements
Rank 1
Antoine asked on 10 Jun 2011, 07:10 PM
Hi !

I'm writing this because I can't find a solution to my problem on other threads, on documentation or by myself...

I'm using a radGridView to display data with radButtons in each rows of my grid. I want to trigger actions when buttons are clicked (this part is working). But When I click a button, the selected row doesn't change and the action is applied to an other item if I don't pre-select the corresponding row.

I've been trying unsuccessfully two ways of resolving this :
- Change the current selected item by clicking on the radButton (and not only on the row).
- Disable my buttons and enabling only those of the selected row.

Here is my radGridView definition

<telerik:RadGridView SelectionMode="Extended" ShowGroupPanel="False" HorizontalAlignment="Left" Margin="0,35,0,0" Name="employeeGrid" VerticalAlignment="Top" Height="554" Width="1012" AutoGenerateColumns="False">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding name}" Header="Name"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding hoursWorked}" Header="Hours worked" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding absenteism}" Header="Absenteism" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding extraHours}" Header="Extra hours" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding timeChecked}" Header="Checked" />
        <telerik:GridViewColumn Width="75">
            <telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <telerik:RadButton Content="Accept" Name="bAccept" Click="bAccept_Click" />
                </DataTemplate>
            </telerik:GridViewColumn.CellTemplate>
        </telerik:GridViewColumn>
        <telerik:GridViewColumn Width="75">
            <telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <telerik:RadButton Content="Details" Name="bDetails" Click="bDetails_Click" />
                </DataTemplate>
            </telerik:GridViewColumn.CellTemplate>
        </telerik:GridViewColumn>
        <telerik:GridViewColumn Width="75">
            <telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <telerik:RadButton Content="Refuse" Name="bRefuse" Click="bRefuse_Click" />
                </DataTemplate>
            </telerik:GridViewColumn.CellTemplate>
        </telerik:GridViewColumn>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

If one of my solutions is viable or if the problem can be solved in another way, I'd be glad to know it.

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 13 Jun 2011, 07:06 AM
Hello Antoine,

Please take a look at this forum thread for a reference.
 

Greetings,
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
Antoine
Top achievements
Rank 1
answered on 13 Jun 2011, 02:27 PM
Hello Maya,

Thanks, that helped a lot.

Tags
GridView
Asked by
Antoine
Top achievements
Rank 1
Answers by
Maya
Telerik team
Antoine
Top achievements
Rank 1
Share this question
or