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

how to find value of boundcolumn in telerik?

1 Answer 372 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Coolbudy
Top achievements
Rank 1
Coolbudy asked on 25 Jun 2013, 10:12 AM
hello friends,

  I want to get value of bound column in itemcommand event in rad grid how can i do this?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Jun 2013, 09:14 AM
Hi Coolbudy,

Please have a look at the following code I tried which works fine at my end.

ASPX:
<telerik:RadGrid ID="RadGrid1" OnItemCommand="RadGrid_ItemCommand" runat="server"
    DataSourceID="SqlDataSource1" AutoGenerateColumns="false" OnItemDataBound="gridDevView_ItemDataBound">
    <MasterTableView CommandItemDisplay="Top" TableLayout="Fixed" DataKeyNames="OrderID"
        ClientDataKeyNames="OrderID">
        <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
        <Columns>
            <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn Text="Get Value" CommandName="GetValue">
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

C#:
protected void RadGrid_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == "GetValue")
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem ditem = (GridDataItem)e.Item;
            string value = ditem["OrderID"].Text;
        }
    }
}

Thanks,
Shinu.
Tags
General Discussions
Asked by
Coolbudy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or