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

Help with Dynamic grid with textbox and calculated columns

1 Answer 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 09 Dec 2010, 01:11 PM
I'm really struggling with this and am sure it's a case of being too deep in it to see the solution...

I'm adding an unknown number of PanelBar items to a RadPanelBar and for each one I'm displaying a RadGrid, essentially giving a user a list of categories (the RadPanelBar items) and a list of items in each category below (in the RadGrid).

The RadGrids need to display static data about each line (part number, description and unit cost) along with a textbox so the user can pick a quantity, and then have a calculated column display the unit cost multiplied by the textbox value (obviously validated to be a number)

However, while I can build the RadPanelBar, PanelBar items, build and attach the RadGrid to each PanelBar, data bind the RadGrids and display the static columns in each one, I simply cant see how to add the textboxes or how to work out what the datafields should be for the calculated column.

If anyone has a sample script (csharp pref) of how to add a textbox column and a calculated column that uses the textbox column then I;d REALLY appreciate it.

Thanks,
Karl

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 14 Dec 2010, 04:04 PM
Hello Karl,

Adding the GridCalculatedColumn should not be causing you troubles, it should happen just as it does with other columns. Since you specify detafields that it needs to calculate, there should be no problem in using it along with any other column that is bound to a datafield in RadGrid's datasource.

Sample code for creating GridColumns in code-behind can be found at that address along with sample code for creating a template column (which I suppose your textbox column will be).

Kind regards,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Karl
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or