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

[Solved] How can i modify a cell

3 Answers 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pepito
Top achievements
Rank 1
Pepito asked on 11 Jun 2008, 04:24 PM
Hi Telerik:

i am creating a radgrid dinamically. after the radgrig has been created i want ot modify some cells. How can i have access to the cell.

for example :


rows/colums      col0    col1   col2 col3

row0                    x          y      z     w

row1                    x          y      z     w

row2                    x          y      z     w

How can i modify de cell allocate in row1 col2.  I must to say  i am using textboxes inside of every cell.

Thank you


  

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 12 Jun 2008, 04:51 AM
Hi Pepito,

Try accessing the Grid cells using the column UniqueName property in the ItemdataBound event.

CS:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
  { 
      if (e.Item is GridDataItem) 
      { 
          GridDataItem item = (GridDataItem)e.Item; 
          string strtxt = item["ColumnUniqueName"].Text.ToString(); 
          if (strtxt == "Sweets") 
          { 
              item["ColumnUniqueName"].Text = "Chocolates"
          } 
      } 
  } 


Thanks
Shinu.
0
Pepito
Top achievements
Rank 1
answered on 12 Jun 2008, 08:32 AM
Hi Shinu:

But this solution is only  working  when i know what is inside of the cell. The most of the cells will be empty and i want to modify a specify cell by position.

x =5 and y y=7 for example, well i can use uniquename for the y position but how can i go to spcecify  x position ?

Regards
0
Princy
Top achievements
Rank 2
answered on 12 Jun 2008, 10:28 AM
Hi,

Go through the following help document link.
Accessing cells and rows

Princy.
Tags
Grid
Asked by
Pepito
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pepito
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or