3 Answers, 1 is accepted
0
Ajay
Top achievements
Rank 1
answered on 02 Mar 2011, 10:27 AM
private void registrationRadGridView_RowLoaded(object sender, RowLoadedEventArgs e) { if (e.Row != null) { var detailsPresenter = e.Row.ChildrenOfType<DetailsPresenter>().FirstOrDefault(); // find needed element var txtReason = detailsPresenter.ChildrenOfType<TextBox>().FirstOrDefault(); if (txtReason != null) txtReason.Text = ""; var btnApprove = detailsPresenter.ChildrenOfType<Button>().FirstOrDefault(); if (btnApprove != null) btnApprove.Content = "my content from localization resource file"; //var btnReject = detailsPresenter.ChildrenOfType<Button>().ToList()[1]; //btnApprove.Content = "Ajay"; //btnReject.Content = "ReAjay"; } }<telerik:GridViewDataColumn Header="Approve" > <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <StackPanel> <Button x:Name="ApproveButton" Margin="4,4,4,4" Height="24" Click="ApproveButton_Click" Style="{StaticResource ButtonStyle1}"> <!--<Canvas Name="CanApproveButton">--> <TextBlock Text= "{Binding LocalizationResources.Approve}" Height="16" /> <!--</Canvas>--> </Button> </StackPanel> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn Header="Reject" x:Name="RejectButton"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <StackPanel> <Button x:Name="btnReject" Margin="4,4,4,4" Content="Reject" Style="{StaticResource ButtonStyle1}" /> </StackPanel> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> </telerik:GridViewDataColumn>0
Ajay
Top achievements
Rank 1
answered on 02 Mar 2011, 10:48 AM
Plese help me out on this ....
0
Hello Ajay,
The UI elements that are placed inside the CellTemplate have nothing to do with the DetailsPresenter, which is the placeholder for the row details. I am not sure why are you searching for your button in the DetailsPresenter. You will never find it there. I am not sure where did you see sample code like this.
To learn what is the difference between cell templates and row details (they don't have anything in common as a matter of fact), please read the following topics:
Bound / Unbound Columns
Row Details
I hope this helps.
Best wishes,
Ross
the Telerik team
The UI elements that are placed inside the CellTemplate have nothing to do with the DetailsPresenter, which is the placeholder for the row details. I am not sure why are you searching for your button in the DetailsPresenter. You will never find it there. I am not sure where did you see sample code like this.
To learn what is the difference between cell templates and row details (they don't have anything in common as a matter of fact), please read the following topics:
Bound / Unbound Columns
Row Details
I hope this helps.
Best wishes,
Ross
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!