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

GridButtonColumn Problem

2 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mohammad
Top achievements
Rank 1
Mohammad asked on 16 Dec 2011, 06:15 PM
hello this is my i want when i click on in retrun my grid's row id in code thanks
<telerik:GridButtonColumn UniqueName="Edit" ButtonType="ImageButton" ImageUrl="../../Images/Edit.png"
                Display="true" Text="<%$Resources:Caption,Edit%>"  HeaderButtonType="PushButton">
            </telerik:GridButtonColumn>

2 Answers, 1 is accepted

Sort by
0
Mohammad
Top achievements
Rank 1
answered on 16 Dec 2011, 06:59 PM
plz help me
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Dec 2011, 07:22 PM
Hello,

<telerik:GridButtonColumn CommandName="123456" UniqueName="Edit" ButtonType="ImageButton" ImageUrl="../../Images/Edit.png"
               Display="true" Text="<%$Resources:Caption,Edit%>"  HeaderButtonType="PushButton">
           </telerik:GridButtonColumn>

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "123456")
            {
                GridDataItem item = e.Item as GridDataItem;
                // access data key
                string str = item.GetDataKeyValue("ID").ToString();
                // access column
                string str1 = item["ID"].Text;
                // access findcontrol
                string str2 = (item.FindControl("TextBox1") as TextBox).Text;
            }
}

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Mohammad
Top achievements
Rank 1
Answers by
Mohammad
Top achievements
Rank 1
Jayesh Goyani
Top achievements
Rank 2
Share this question
or