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

New Row with "Interface-Bound" GridView

1 Answer 46 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nils
Top achievements
Rank 1
Nils asked on 11 Aug 2009, 09:44 AM
Hi.
I am looking for "the right way" to add new Rows to a GridView...
1. Is there any pre-defined method to add new rows ? (Like the WinForms MS-Grid used to have...)
Something like:
AddNewRowIfUserDoubleClicksTheLeftPane="true" 

2. I am displaying some navigateable Properties which are based on Types of which I know the Interface only..
Something Like:
public class DisplayData  
{  
   public string Name { getset; }  
   public ISomeInterfaceType Prop { getset; }  
}  
  
public interface ISomeInterfaceType  
{  
   string OtherName { get; }  
}  
<telerik:GridViewDataColumn     
     Header="Name"    
     DataMemberBinding="{Binding Path=Name, Mode=OneWay}"    
     Width="2*"    
     IsReadOnly="True"/>    
<telerik:GridViewDataColumn     
     Header="Other"    
     DataMemberBinding="{Binding Path=Prop.OtherName, Mode=OneWay}"  
     DataType="{x:Type sys:String}"  
     Width="3*"    
     IsReadOnly="True"/>
However, I want to be able to let the user add new rows - in which case I need two entered strings (which I check for validity) and afterwards return the new "DisplayData"-Object. Currently I am doing this using a new Window (ShowDialog()) which let's the User input his data...

Can I use the "new-row" feature of the GridView, if some columns are bound to read-only properties or even classes of which I know only the Interface ?

Yours,
Nils


1 Answer, 1 is accepted

Sort by
0
Accepted
Nedyalko Nikolov
Telerik team
answered on 14 Aug 2009, 08:57 AM
Hello Nils,

Straight onto your questions:

Question #1: As I understand you need an event called something like "BeginningInsert" where you can show custom edit form. Current version of the RadGridView does not have such predefined method or event you can use for this purpose. We will consider adding such event for the next versions of the RadGridView control.

Question #2: Unfortunately with any kind of nested properties (interface or class) there are some restrictions when you try to add values, no problem with editing but you have to add values for such properties from code behind.

All the best,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Nils
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Share this question
or