Questions tagged [datakey]
31 questions
53
votes
5 answers
Get DataKey values in GridView RowCommand
I have a GridView with an associated DataKey, which is the item ID.
How do I retrieve that value inside the RowCommand event?
This seems to work, but I don't like the cast to LinkButton (what if some other command is firing the event?), and I'm not…

Farinha
- 17,636
- 21
- 64
- 80
4
votes
2 answers
Telerik - Image button inside a Grid row, getting value of first cell
I have a RadGrid that contains a template column in which I've put two image buttons for edit and delete actions.

PercivalMcGullicuddy
- 5,263
- 9
- 46
- 65
2
votes
1 answer
Get multiple row DataKeys from gridview
Currently I have a Button Click event which takes the DataKey from a row in a Datagrid (via a checkbox) and assigns it to an INT variable to Update an Individual in a databsse. Everything works fine when I only check 1 checkbox and run the Update.…

EB.
- 2,627
- 8
- 35
- 55
2
votes
1 answer
React DataKey in Charts
I am consuming data fixtures to fill the charts built with Recharts
I have two objects in my data: Finances and DAU
const charts = [
{
name: 'Finances',
data:[
{name: 'April', Balance: 48530, saving: 0},
{name: 'May', Balance:…

Koala7
- 1,340
- 7
- 41
- 83
2
votes
3 answers
GridView Paging, unable to get the correct Datakey value
GridView

Thomas
- 342
- 11
- 29
2
votes
3 answers
Getting dataKey value for each row in grid view
I am having some problem when trying to get the data keys value from grid view. Here is the code:
GridView gvForCheckBox = (GridView)e.Item.FindControl("gvProduct") as GridView;
foreach (GridViewRow gr in gvForCheckBox.Rows)
{
//If product name…
user2531590
1
vote
1 answer
DataKeyNames issue with my GridView
I've been having this problem with my DataKeyNames value. The primary key of each row is the GameID but whenever I set the DataKeyNames equal to the GameID, it doesn't work.
I am enabling selection in my gridview because I want additional…

omar
- 11
- 2
1
vote
1 answer
prime ng row expansion data key issue
I am using prime ng table with row expansion, but I think the problem is with my data key. row is not expanding when I use dataKey="id" if I use Munit.id all rows expand instead of one
html file

Dawood Sherazi
- 21
- 6
1
vote
1 answer
Retrieve value of complex object bound to gridview control
The gridview control makes databinding of complex objects rather easy. In my scenario a gridview control gets bound to a Customer object which has a few 'flat' properties and one complex property that takes an object of the type Address. The grid…

Martin
- 185
- 1
- 1
- 10
1
vote
2 answers
Using HTML attribute within CMS source code
Im using Prestashop for a website where the content pages are build using:
Prestashop > Preferences > CMS > Source-Code.
So for each CMS page i use source code which is basic HTML.
THE PROBLEM
Im trying to integrate a widget to the site CMS page,…

Ylama
- 2,449
- 2
- 25
- 50
1
vote
1 answer
Getting the DataKey Value in ASP.NET GridView on Button command event
Gridview is configured:

RobWaibel
- 13
- 1
- 3
1
vote
1 answer
What is the difference between following code
var id = Convert.ToInt32(GridViewVehicleList.DataKeys[e.NewSelectedIndex].Value);
var id2 = Convert.ToInt32(GridViewVehicleList.DataKeys[e.NewSelectedIndex].Values);
if i use second code as
id2 =…

osmanedip
- 77
- 3
- 12
1
vote
2 answers
DataKeyValues are null in gridview
Here is my gridview and the event that fires when a user clicks on the edit button within the row. for some reason my datakey value is crashing the program saying it is null. im not sure why. the DataKeyNames in the gridview is exactly what I…

Jon Baxter
- 37
- 1
- 9
1
vote
3 answers
How to prevent duplicate data in the grid view?
I have a grid view and this grid view has a DataKeyNames="person_id"
Now I want this key as a primary key for the grid so no allowed duplicates .
How to prevent duplicate data through using DataKeyNames

Anyname Donotcare
- 11,113
- 66
- 219
- 392
1
vote
4 answers
How to find row index with respect to datakey in GridView asp.net
i have a gridview control in which paging is enabled, i have a datakey value,i want to find a row index with respect to datakey value ,i have this code,
protected int GetRowIndex(object userID)
{
for(int i = 0l i <= GridView1.DataKey.Count -1 ;…

Salman Roy
- 575
- 2
- 12
- 27