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

How to put a row in edit mode?

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saad
Top achievements
Rank 1
Saad asked on 06 Dec 2008, 01:11 PM
Sir, I am trying to put row in edit mode when a GridEditCommandColumn is clicked on each row. I`v defined the edit mode that it`ll be having a Radtextbox and two imageButtons. I want this edit form showing to be at client side.....what should i do?
I am now so so so confused, I`v tried almost everything but my javascript isnt working. I also tried copying the code given for help, but no signs of any progress.

And after that i want the text to get from RadtextBox when one imagebutton is clicked out of two and some hiden columns values of that specific row to call my webservice, but all this at the client end. Please help me.
Can you provide me some code for it? Please....

Here`s my server side code for that above mentioned processes:

 

protected

void RadGrid_NoteBook_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

    if (e.CommandName == "Note") // when imageButton 'Note' is clicked

 

    {

 

        RadTextBox textBox = new RadTextBox();

 

 

        foreach (GridItem item in RadGrid_NoteBook.MasterTableView.Items)

 

        {

 

            if (item.Edit)

 

            {

 

                GridEditFormItem editItem = (GridEditFormItem)RadGrid_NoteBook.MasterTableView.GetItems(GridItemType.EditFormItem)[item.ItemIndex];

 

                textBox = (

RadTextBox)editItem.FindControl("NoteBook_NoteBackTextBox");

 

                editItem.Edit =

false;

 

 

                break;

 

            }

        }

 

 

 

 

        GridDataItem gitem = (GridDataItem)e.Item;

 

 

        Hashtable table = new Hashtable();

 

        gitem.ExtractValues(table);

 

 

        string temp_UserId = table["SenderUserId"].ToString();   // my hidden cloumn 'SenderUserId'  value
        Guid UserId = new Guid(temp_UserId);

 

 

        string Username = table["SenderUsername"].ToString();    

 

 

        Guid SenderUserId = new Guid(Session["UserId"].ToString());

 

        DataSetTableAdapters.

Queries query = new DataSetTableAdapters.Queries();

 

        query.InsertNotes(Session[

"Username"].ToString(), SenderUserId, textBox.Text, DateTime.Now);   // my query fo insertion in database

 

 

        int NoteId = (int)query.GetNoteIdFromSenderUsernameAndSenderUserId(Session["Username"].ToString(), SenderUserId, textBox.Text, DateTime.Now);

 

        query.InsertIntoUser_NoteBookFromNoteId(UserId, NoteId);

        }

 

        

 

}

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 09 Dec 2008, 08:30 AM
Hello saadi,

Do you mean that you need to perform client-side updating with RadGrid? In this case I suggest that you review the following online resources for further information how to achieve it:

http://demos.telerik.com/aspnet-ajax/Grid/Examples/Client/InsertUpdateDelete/DefaultCS.aspx
http://www.telerik.com/help/aspnet-ajax/client-update-insert-delete.html

Let me know if this helps.

All the best,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Saad
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or