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

[Solved] Inserting data into radgrid cells programatically

4 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mahita Ande
Top achievements
Rank 1
Mahita Ande asked on 09 Feb 2010, 08:40 PM
Hi,
    I have a webpage with a RadGrid control (with 5 columns) and a button.
column2, column3 and column4 are combo boxes tied up with data. I want to populate the column1 with a value only when I click the button.

I inserted the following piece of code in the button click event to populate the value into the column1 of the radgrid, but did not work.

Private Sub btnAssignAccessionNumbers_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAssignAccessionNumbers.Click

 

 

 

 

    RadGrid1.Items(0).Cells(0).Text =

"M123"

 

 

 

 

 

End Sub

 

Please let me know the correct syntax/procedure to update column cells when I click the button. Also how to modify the radgrid cells programatically.

Thank you,
Mahita

 

 

 

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Feb 2010, 05:36 AM
Hello Mahita,

Use the ColumnUniqueName property to access the cell, as shown below.

CS:
 
RadGrid1.Items(0)("ID").Text = "M123" 
RadGrid1.Rebind() 
[ID is the columnuniquename of the first column]

-Shinu.
0
Mahita Ande
Top achievements
Rank 1
answered on 10 Feb 2010, 03:35 PM
Thank you, Shinu.

I tried it but it does not appear to work.

Also I have another problem. In reference to the explanation of my design in the previous post, I wish to populate the column5 with respect to column2 either while selecting a value in column2 or while on insert command. To elaborate, if I select a code in column2 I wish to see the related description in column5.

Your suggestions are greatly appreciated.

Mahita
0
Tsvetoslav
Telerik team
answered on 16 Feb 2010, 07:44 AM
Hello Mahita,

Please, close the  current forum thread and leave the discussion to the formal support ticket where I have responded to your questions.

Thank you. 

Best wishes,
Tsvetoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mahita Ande
Top achievements
Rank 1
answered on 16 Feb 2010, 02:33 PM
Closing the thread. Question being answered by the support member.

Thank you,
Mahita
Tags
Grid
Asked by
Mahita Ande
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mahita Ande
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or