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

[Solved] RadGrid Template Row that contains a RadEditor

3 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Holdorf
Top achievements
Rank 1
Steve Holdorf asked on 16 Jul 2013, 08:04 PM
I have been tasked with a portion of a product in which I think I have a solution but need a little assistance with the code design. I will describe the architecture and if you could provide some sample code in your reply that would be great. We do have the 2013 RAD AJAX Controls.

What I want to do is have a RadGrid work as a repeater control and have each row contain a RadEditor. Now, the grid will start with one empty row displayed which will allow for text to be entered. So far so good. Now, as soon as the user pastes an image, below the text, into the editor control I want a small radwindow popup to display (or hidden panel with the radio buttons on it as part of the row display) with a radio button list so the user can select the kind of image (i.e. House, Car, Boat) that was pasted in the that row's editor. After the user selects the kind of image and closes the radwindow then a new row should be inserted into the radgrid below the previously inputted row. After this new row with a fresh radeditor is displayed the user just repeats the process typing in text until the next image is pasted below the text and at that point it just repeats, a radwindow opens (or hidden panel part of the row), they select the kind of image (i.e. House, Car, Boat), then close the radwindow and have a new grid row display again. Like I stated, it may be better to have a hidden panel with radio buttons display and not have a pop up radwindow display. This is the part I am unsure of and maybe you can help me decide here as well. 

Also, at some point I will have to allow for rows to be deleted or inserted.

Can you guy's give me a simple code sample that will allow me to do this. This customer represents a big contract.

Thanks,

Steve Holdorf
lovehans@nc.rr.com
holdorfs.ctr@jdi.socom.mil

3 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 19 Jul 2013, 08:04 AM
Hello Steve,

If you want to use RadWindow you could go through the help article below which describe its client-side API and methods like show and hide to open and close the RadWindow. Additionally, you could add new row to the grid by using a dummy data source in which you add a new item and then Rebind the whole grid.

Note that your requirements are highly custom and out of bounds of your support service. However, you could write to services@telerik.com which provide support for building custom solutions. You could find more information in the link provided below.

Regards,
Antonio Stoilkov
Telerik
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 the blog feed now.
0
Steve Holdorf
Top achievements
Rank 1
answered on 19 Jul 2013, 10:09 PM
After reviewing your post's link and thinking about how a radeditor controls works, I see now that a paste event would have to be a client side event. That being the case the only thing I can think of is some other way to make it work. It seems that I would need to have more input from the user. At this point I need to get the individual pieces working. Yesterday I was able to get text followed by an images, located in the RadEditor, stored into a MS SQL database nvarchar(Max) column. Now, the next piece I am going to work on is adding the radeditor to some type of repeater grid, then going from there.

Thinking about it my datasource for the grid, it could be a generic collection of objects (List<myObject>) with the following properites 1. a string property nvarchar(Max) for the editor's content 2. a text property for the image type (i.e. House, boat, car). Then each time a new row is added the server side code would add the newly created row into the list and on each addition to the generic list rebind to the grid. Also, by having the radgrid content value stored as a nvarchar(Max) that data would be searchable.

Do I seem to be more on track with an out of the box design?

Thanks,


Steve Holdorf 
0
Antonio Stoilkov
Telerik team
answered on 24 Jul 2013, 01:34 PM
Hi Steve,

The approach that you have described for your solution sounds great. The described approach associated with adding new items in the grid is the recommended way for such scenarios. Using a List<CustomObject> is the perfect way to add new item by just appending to the list and rebinding. Note that you could store the custom List in a ViewState or Session variable to persist its state through postbacks.

Regards,
Antonio Stoilkov
Telerik
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 the blog feed now.
Tags
Grid
Asked by
Steve Holdorf
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Steve Holdorf
Top achievements
Rank 1
Share this question
or