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

Populating a column dynamically

1 Answer 15 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kathy
Top achievements
Rank 1
Kathy asked on 14 Nov 2010, 07:58 PM
I have a RadGrid, a textbox and submit button on my form.  The textbox will only allow numbers.  My grid is populated with data.  What I need to do is to take what the user entered in the textbox, take that value and get a random number out of it and then fill up one of the columns in the table with these random numbers.  So if I have 50 rows, I would be filling it with 50 random numbers.  Which event would I need to handle to accomplish this?  Thanks.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 18 Nov 2010, 11:03 AM
Hi Kathy,

Do you need to add these numbers to RadGrid's data source? In this case you could handle the Click event of your button, update RadGrid's data source with the random numbers and rebind the grid to reflect the changes.

Alternatively, if you only need to show these random numbers in grid column cells without actually persisting them in RadGrid's data source, you would need to loop through all the grid items, find the respective column using its unique name (in the format DataItem["ColumnName"]) and either set the cell text or find a control inside that will show the value.

Hope this helps. Let me know if further clarification is required.

Veli
the Telerik team
Browse the vast support resources we have to jumpstart 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
Kathy
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or