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

Set value for non-bound column

1 Answer 134 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kathleen Ryan
Top achievements
Rank 1
Kathleen Ryan asked on 17 Jan 2008, 04:50 PM

Language: vb.net

I'm having a really difficult time getting changes to cell values displayed in a radGrid.

The grid is bound to a dataset containing the output of a SQL Server stored procedure that returns a list of documents.

In addition to the columns that are mapped to particular elements in the dataset (docName, docLocation), I also display a column (status) that is not mapped. 

Here's what I want to do: At runtime, after the grid has been populated, displayed, and the end user has selected several of the rows, I would like to traverse the SelectedRows collection of my grid, set the "status" column value to "S", and have these updated values displayed in the grid:

For Each row As GridViewRowInfo In dgEquiset.SelectedRows
cell = row.Cells("selected")
cell.Value = "selected"
Next

I don't get any errors, but the values don't get set.

How do I go about doing this properly?

Thanks!




1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 18 Jan 2008, 01:00 PM
Hello Kathleen Ryan,

Thank you for this question.

Currently, RadGridView does not support persisting values for unbound columns. We will implement this feature in our upcoming major release - 2008 Q1.

I suggest using the following code to work around this issue:

Private Sub radGridView1_RowFormatting(ByVal sender As ObjectByVal e As RowFormattingEventArgs) 
    If e.RowElement.IsSelected Then 
        e.RowElement.RowInfo.Cells("Selected").CellElement.Text = "S" 
    Else 
        e.RowElement.RowInfo.Cells("Selected").CellElement.Text = "" 
    End If 
End Sub 

We hope this information helps you. Let us know if you need further assistance.

Best wishes,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Kathleen Ryan
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or