Questions tagged [datakey]

28 questions
52
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
  • 16,296
  • 21
  • 61
  • 79
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
  • 3,923
  • 8
  • 42
  • 60
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,373
  • 8
  • 32
  • 46
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,501
  • 6
  • 37
  • 69
2
votes
3 answers
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
  • 1
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,040
  • 19
  • 44
1
vote
1 answer
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
  • 11
1
vote
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
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
  • 10,000
  • 54
  • 200
  • 355
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
  • 555
  • 1
  • 11
  • 26
1
vote
2 answers

When checkbox checked get datagrid value using jquery

I have a checkbox template field within a gridview in c#, this field also has a hidden field with the id behind it. I want to use jQuery to raise an event on click of the checkbox to grab a datakey value so I can run a query through jQuery and add…
Jason
  • 59
  • 1
  • 2
  • 10
1
2