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

To Access the value of the Gridbound column in the button click event handler

1 Answer 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Deepika
Top achievements
Rank 1
Deepika asked on 17 Feb 2012, 05:30 AM
Hi,
I have a grid, in that I have 3 GridBound Columns and 2 Grid Template columns (Dropdowns) and one other GridTemplateColumn (radButton).

On Click on this button, I want to collect the data from the Gridbound column, Grid Template column and then do some operation.
How can I do this?

<

telerik:GridTemplateColumn HeaderText="Action" ColumnEditorID="clmEd150px"> 
<HeaderStyle Width="20%" />  
<ItemStyle HorizontalAlign="Left"></ItemStyle>  
<ItemTemplate>
<telerik:RadButton ID="rdBtnDoSomeOp" runat="server" ButtonType="StandardButton" Text="Do Some Operation" Skin="Office2010Black" OnClick="rdBtnDoSomeOp_Click">

</telerik:RadButton

</ItemTemplate>

</telerik:GridTemplateColumn>  

protected

void rdBtnDoSomeOp_Click(object sender, EventArgs e)  

{

}

Thanks and Regards,
Deepika Karanth

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Feb 2012, 05:52 AM
Hello Deepika,

Try the following code.
C#:
protected void rdBtnDoSomeOp_Click(object sender, EventArgs e)
{
 foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
 {
  string columnvalue = item["uniqueName"].Text;
 }
}

-Shinu.
Tags
Grid
Asked by
Deepika
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or