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

Dynamic Data support in Grid

3 Answers 58 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Supriya Naik
Top achievements
Rank 1
Supriya Naik asked on 20 May 2010, 02:03 PM
Hi
I am developer from Microsoft. We are currently using silverlight version of telerik Grid.
I was surprised to know that there is no support for dynamic data in Grid.
What i mean  by dynamic data is "DataSource where columns (name, type)  are not known untill Run Time"
I was able to create columns at runtime but unable to create new row and assign data to row's cells.
Can you guys suggest me any alternatives.

Thanks in Advance
Supriya Naik

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 May 2010, 02:23 PM
Hi,

You may need to check this blog post for more info.

Sincerely yours,
Vlad
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
Supriya Naik
Top achievements
Rank 1
answered on 20 May 2010, 08:10 PM
Thanks for the quick response... pseudo DataTable Class (Lightweight DataTable) will help in my scenario. But it is kind of workaround and i guess it uses reflection internally which i wanted to avoid due to performance reasons.

I was just wondering  why am i not able to create a row programatically and assign data into the cells? I am very new to the silverlight GridView, that is why i might be missing something in my code...pasting the code below for reference

if

 

 

(data != null && data.AttributeDataRows != null)

 

{

 

 

    foreach (AttributeDataRowDTO attRow in data.AttributeDataRows)

 

    {

        row =

 

new GridViewNewRow();

 

 

 

        foreach (AttributeDataDTO attCol in attRow.AttributeColumns)

 

        {

            row.Cells[columnDetail[attCol.Code].ColumnIndex].Content = attCol.Value

 

;

 

        }

        radGridView.Items.Add(row);

     }
}

Here, after creating a new row, its Cells collection is by default empty...i mean there are no cells in the row...so when i am accessing the cell by passing columnindex, it is giving exception.

All i want to know is how to set data of a particular cell of a row having a particular column.

Thanks,
Supriya Naik

0
Vlad
Telerik team
answered on 21 May 2010, 06:55 AM
Hello,

No, the DataTable will not use reflection - you can check the code.

In Silverlight (and WPF) world, advanced virtualized items controls similar to RadGridView with container recycling will not allow you to work directly with UI - you can use MVVM pattern to create your own model of data and assign this to the grid.

Regards,
Vlad
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.
Tags
GridView
Asked by
Supriya Naik
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Supriya Naik
Top achievements
Rank 1
Share this question
or