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

[Solved] Trying to do inplace edit ...

4 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
S
Top achievements
Rank 1
S asked on 14 Sep 2009, 08:42 PM
Hi,
I am trying to implement inplace edit in one of the grids that we use, but its turning out to be too complex to understand.

It should have been a cake walk but apparently there is a lot that I need to learn.

So I have a radgrid like below:
<telerik:RadGrid ID="rgLineItems" runat="server" 
        AutoGenerateColumns="False"  AllowAutomaticUpdates="True"  OnItemUpdated="rgLineItems_ItemUpdated">

I am just showing the code thats important so as to improve the signal to noise ratio. Besides, I like to know exactly what every attribute does before I use it....

Now within the grid I have this edit column:
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <ItemStyle CssClass="EditRowImageButton" Width="10%"/>
                    </telerik:GridEditCommandColumn>

This is cool that it adds the edit button for each row automatically.

Now I have the actual data column like below:
<telerik:GridBoundColumn HeaderText="Line" DataField="Line" UniqueName="Line" 
            Visible ="true" ColumnEditorID="LineNumberColumnEditor">                               
            <HeaderStyle HorizontalAlign="Center" Width="10%"></HeaderStyle>
        </telerik:GridBoundColumn>

The  inplace editor is declared like this:
<telerik:GridTextBoxColumnEditor ID="LineNumberColumnEditor" runat="server" TextBoxStyle-Width="20px" />


Now I have no idea what to do next.

On clicking the pencil image (the edit command  button), there is a postback to my page .... but in your example, the in place editor was showing up.... How do I achieve that?

Thanks,
Sunil

4 Answers, 1 is accepted

Sort by
0
S
Top achievements
Rank 1
answered on 14 Sep 2009, 09:06 PM
Ok.... no worries ... I found out .... I just need to add the event  handler for NeedDataSource for my grid....

And the in place editor appears ...
0
S
Top achievements
Rank 1
answered on 14 Sep 2009, 09:19 PM
The next problem is to handle the "update" event.
Once the in-place editor appears, I can see the update and cancel buttons showing up.

Problem 1: Clicking on the cancel image makes another call to the server rgLineItems_NeedDataSource() handler. If there are no changes then they should be handled by the client itself.

Problem 2: Clicking on the update image - I can't figure out how to find the row and the data that changed.....

Need help here ....

thanks,
Sunil
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 Sep 2009, 05:49 AM
Hello Sunil,

1) I tried the same scenario at my end but could not replicate the issue that you observed. I'm not sure whats happening at your end but can you check if you are calling a Rebind method in any grid event, which will automatically trigger the NeedDataSource event. Refer to this link which mentions the same.

2) Check out the following help documents to understand how to access row data or control values while updating. Probably this should guide you to meet your requirement.
Insert/Update/Delete at database level with queries
Updating values in-place and with edit forms

Thanks
Princy.
0
S
Top achievements
Rank 1
answered on 15 Sep 2009, 01:04 PM
Thanks Princy,
I found out about the database level query thing and it works that way.
I did not check the other link ... will do it now ....

Sunil
Tags
Grid
Asked by
S
Top achievements
Rank 1
Answers by
S
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or