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

get datakey value radlistview

2 Answers 748 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Prassin
Top achievements
Rank 1
Prassin asked on 06 Aug 2012, 05:29 AM
Hi All,

How to get the data key value of a rad list view control in item command. 

Regards,

Prassin

2 Answers, 1 is accepted

Sort by
0
Prassin
Top achievements
Rank 1
answered on 06 Aug 2012, 05:36 AM
I have fix the issue by applying like this..


protected void RadListView1_ItemCommand(object sender, RadListViewCommandEventArgs e)
{
    if (e.CommandName == RadListView.SelectCommandName)
    {
        RadListViewDataItem item = e.ListViewItem as RadListViewDataItem;
        string myValue = item.GetDataKeyValue("myValue").ToString();
    }
}


Regards,

Prassin
0
Asromi
Top achievements
Rank 1
answered on 05 Jun 2017, 03:15 AM

protected void RadListView1_ItemCommand(object sender, RadListViewCommandEventArgs e)
{
    if (e.CommandName == "yourCommandName")
    {

       RadListViewDataItem eItem = (RadListViewDataItem)e.ListViewItem;

        string myValue = eItem.GetDataKeyValue("myValue").ToString();
    }
}

Tags
ListView
Asked by
Prassin
Top achievements
Rank 1
Answers by
Prassin
Top achievements
Rank 1
Asromi
Top achievements
Rank 1
Share this question
or