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

problem with grid view edit

7 Answers 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sirisha
Top achievements
Rank 1
sirisha asked on 16 Feb 2011, 03:49 PM

I’m having problem with grid view edit functionality.

I’m trying to implement edit in  a popup window. When I select a row for edit, it is giving some other row information in edit screen.

Do I need to pass the Row index or something like that to the popup?

7 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 16 Feb 2011, 04:35 PM
Hello,

We actually use a pop up edit screen too, rather than in grid editing in our applications. When you get the row to pass to the edit form, you can get the DataBoundItem.
You can get to the current row via
Me.RadGridView1.CurrentRow
and from that get
Me.RadGridView1.CurrentRow.DataBoundItem
 which you can then convert to the type that you grid is bound to. E.g. a custom object. This can then be passed to your form, and when the form closes, for exmaple when the DialogResult is OK, then you can retrieve a property on your pop up form that gives you back the altered object.

Hope that helps, but let me know if you need more information
richard
0
sirisha
Top achievements
Rank 1
answered on 16 Feb 2011, 04:54 PM
I'm accessing the row values similarly in edit popup. But when i click on edit column, i can see the data in the grid moving(i.e., a different row values in the selected row position) and the new row is displayed in the popup.
0
Richard Slade
Top achievements
Rank 2
answered on 16 Feb 2011, 05:00 PM
Hello,

I'm afriad I am not quite sure what you mean. I have not experienced this issue. I'd first suggest upgrading to the latest version (2010 Q3 SP1) if you're not already using it. If you are, then perhaps you can give more details/code sample on how you are selecting the current row for edit.

For reference, when we have a RadGridView on a form, we also couple this with a RadCommandBar, that has an add/edit button, a RadContext menu on the grid. When the user presses the edit, or selects edit from the context menu (or indeed double clicks a row) then the form is shown as a dialog window with the databounditem from the row passed to the edit form.

Please let me know further details if you need more help and I'll be happy to assist
Thanks
Richard
0
sirisha
Top achievements
Rank 1
answered on 16 Feb 2011, 06:19 PM
I'm using trail version of telerik and visual studio 2008. Can this be a problem?
0
Richard Slade
Top achievements
Rank 2
answered on 16 Feb 2011, 06:23 PM
Hello,

If you're using the latest version, which is likely (version 2010.3.10.1215) then no, using the trial version is just the same as the full version. I'd like to help so you have the confidence to go ahead and buy the telerik controls. Are you able to replicate this in a sample project and post it here using the code formatting block?
If you can, I'll be very happy to take a look at it for you.
Regards,
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 16 Feb 2011, 06:27 PM
Hello,

It's just a thought, but you say that the row is 'moving'. Please can you set the following in case you are accidentally resizing the rows.
this.radGridView1.AllowRowResize = false;

otherwise, as above, if you can post a sample, and explain in further detail I'll do my best to help
Richard
0
Stefan
Telerik team
answered on 21 Feb 2011, 08:23 AM
Hi sirisha,

Thank  you for writing.

You can find an example of the desired behavior in this KnowledgeBase article.

I hope this helps. Let me know if you need further assistance.

All the best,
Stefan
the Telerik team
Tags
GridView
Asked by
sirisha
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
sirisha
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or