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

How to persist the value after postback with in radgrid form template

1 Answer 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Achuthan
Top achievements
Rank 1
Achuthan asked on 06 Jan 2012, 10:36 AM
Hello All,
      i added one radgrid dynamically in asp.net application. in the radgrid i am using the form template to insert and update the record, i have three columns in the grid like Col1,Col2,Col3. all are the textbox columns. Col3 have one radimagebutton. if i click the radimagebutton it will open the radwindow and i pick some image after click ok button in the radwindow it will bind the value in Col3 textbox, this functionality is fine, but my question is

1. i entered some value in col1 and col2 textbox
2. after bind some image value in the Col3 textbox. col1 and col2 textbox values are gone because of postback
3. above scenario i handle in insert button through grid_itemCommand event, if i insert the form template all values are persist
4. but when i update that time i cannot able to persist the col1 and col2 values, col3 values are there
5. when i click the insert button in grid_itemcommand event the item will come as grideditformitem, so i can able to get the entered value using
GridEditFormItem item = (GridEditFormItem)e.Item;
string col1value=item.FindControl("Col1textboxid").Text;
and rebind to the corresponding textbox
6. when i click the update button in grid_itemcommand event the item will come as griddataitem, here i cannot find the control and cannot get the value, please tell me to persist the value

Kindly tell me how to resolve this issue

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 10 Jan 2012, 04:16 PM
Hello,

I am not sure that I understand correctly, what is the problem and what is the expected behavior.

Let's clarify the steps to reproduce the issue:

  • Screenshot of the Grid will help us to better understand the layout of your RadGrid.
  • RadGrid is rendered on the page, what button the user should press in order to get the RadGrid in Insert or Edit mode? Where this button is located? What is the command name of this button?
  • After the RadGrid has entered in Insert mode, what button the user is pressing? Where this button is located? What is its command name?
  • After the RadGrid has entered in Edit mode, what button the user is pressing? Where this button is located? What is its command name?
  • How the third column is organized, what controls are included, what is its purpose?
  • What is the content of the ItemCommand event handler and what is the RadGrid declaration with the respective event handlers?
  • Do you wan to save the values from the TextBox controls from the col1 and col2 columns into database or you want to persist their values between postbacks?

It would be best if you  isolate the project, open formal support ticket, and send it to us for local test/debug.

Kind regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Achuthan
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or