How to put a row in edit mode?

2 posts, 0 answers
  1. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 06 Dec 2008 Link to this post

    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);

            }

     

            

     

    }

  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 09 Dec 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top