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

Generating a RadView

4 Answers 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 24 Nov 2010, 05:41 PM
Hi,

I am working on RadGridView and catching the events based on selection of some cells with SelectedCellsChanged.
Every click on a cell should generate a RadGridView dynamically based on the content of the clicked cell. The format of all the generated RadView will be the same.

I can get the content of the cell clicked in the event handler function. My question is how to generate RadGridView dynamically and to use the values from the event handler function. In the attached file, I have shown the cell and just below in DetailedData groupbox I need to generate the RadGridView.

Thanks

4 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 24 Nov 2010, 06:43 PM
Hi Mark,

I'm not sure what you mean by generating a RadView, but it sounds like you may be looking for some sort of master / detail view. Is that correct? If so, have you looked at creating a hierarchy grid?

Have a look in the demos on your PC that came with the controls under GridView >> Hierarchy and also at this link.

hope that helps, but let me know if you need more information.

Richard
0
Mark
Top achievements
Rank 1
answered on 24 Nov 2010, 08:00 PM
Thanks. I am new to Telerik and WPF all together so not strong on concepts.

The table shown in my attachment has this interaction logic:

public partial class SummaryTable : UserControl
  {
      public SummaryTable()
      {
          this.InitializeComponent();
      }
      private void MainGridView_SelectedCellsChanged(object sender, GridViewSelectedCellsChangedEventArgs e)
      {
          IList<GridViewCellInfo> cellList =  this.radView1.SelectedCells;
         GridViewCellInfo cellInfo = (GridViewCellInfo)cellList.First();
         
         // Initialize MyView object based on cellInfo.Item to capture the details of whole row
      }
}

          
The problem is how to pass this MyView object to Top-level ViewModel class so that it can initialize the second table that I want to generate based on the MyView object. I was thinking that when Top-level class will get notified about the new MyView object then it will set the DataSource for the second table to populate it.

Please let me know if you have any other suggestions. I am a new player :)

Thanks.
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 24 Nov 2010, 08:32 PM
Hi Mark,

You've mentioned WPF. If you are using WPF, you'll need to head over to the Telerik WPF Forums as that's where the WPF experts live.
Is that what you mean?
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 24 Nov 2010, 08:34 PM
By the way, if you don't mean WPF, you can easily tap into the row or cell by using
RadGridView.CurrentRow
RadGridView.CurrentCell

hope this helps
richard
Tags
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Mark
Top achievements
Rank 1
Share this question
or