Hello,
I am stuck at this part for hours and not able to find an answer on how to do this. I am can do this with the normal gridview but not with radGridView.
I have a radGridView with 7 columns. And I want to get the cell value of the 6th column base on the row index of a double click. Because sometimes I click on column 2..but I don't want the cell value of column 2. I want the cell value of column 6.
Please help...Thanks...
13 Answers, 1 is accepted

Just do the following to get the value from a specific row:
void
radGridView1_CellDoubleClick(
object
sender, GridViewCellEventArgs e)
{
var value = radGridView1.Rows[1].Cells[6].Value;
}
Or for the current row:
void
radGridView1_CellDoubleClick(
object
sender, GridViewCellEventArgs e)
{
var value = radGridView1.Rows[e.RowIndex].Cells[6].Value;
}
Hope this helps, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga
Telerik WinForms MVP

Hello Emanuel Varga
I just figured out that radGridView uses Row Index and Cell instead of Column Index. And now your reply confirm my findings that it's the Cells that I want to reference instead of the Column.
I do have another problem that I can't seem to figure out. Can you help me with it? Here's the link.
http://www.telerik.com/community/forums/winforms/combobox-and-listbox/bind-image-to-a-databind-combobox.aspx

but this is good way to do it that worked for me.
Dim cell As Telerik.WinControls.UI.GridDataCellElement = TryCast(sender, Telerik.WinControls.UI.GridDataCellElement)
Dim value= RadGridView1.Rows(cell.RowIndex).Cells(5).Value)
I am glad to hear that you have found a way solve your issue. I just want to mention that RowIndex comes from the event arguments in the CellDoubleClick event, just like Emanuel mentioned. Note that the discussed version of RadControls for WinForms here is Q3 2010.
Should you have any other questions, do not hesitate to contact us.
All the best,
Stefan
the Telerik team

You are right, I blame haste makes waste, missed it the first time I looked.
r.

I using a demo version and if i can´t figure out this i will change to other asp.net control pack. Some things here a so complicated.
Tks,
Lourival.
Thank you for writing.
Please note that this forum concerns RadGridView for WinForms rather than RadGridView for ASP.NET AJAX. Please address your question in the appropriate forum, where you can get your answer.
All the best,
Stefan
the Telerik team

Try the following code.
C#:
protected
void
grid_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
TableCell cell = (TableCell)item[
"UniqueName"
];
}
}
Accessing Cells and Rows.
-Shinu.

Please note that this forum concerns Telerik UI for WinForms, and the RadGridView control in it, has Rows property with an indexer.
I hope this helps.
Regards,
Stefan
Telerik

Thank you for writing.
RadGridView is virtualized and its cell and row elements cannot be accessed by index because the control reuses its visual elements. Please refer to the following documentation articles: Accessing Cells, CellFormatting, RowFormatting. You can handle the events at run-time and add you custom logic there.
I also understand that you might be trying to use an automation tool .Could you please open up a support ticket and provide us with details of what you would like to accomplish and a sample of the grid you would like to test?
I hope this information was useful. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik by Progress