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

Rad Grid Form Template not working

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rakesh menon
Top achievements
Rank 1
rakesh menon asked on 24 Mar 2010, 01:48 PM
Hi,
I am developing a composite control with a radgrid in hierarchy.Everything works well for me except the Edit Form. I have created a new FormTemplate which inherits from the ITemplate class and use that as a formTemplate for my grid as
mainGrid.MasterTableView.EditFormSettings.EditFormType =new MyTemplate(); 
But for some reason my Edit Form always appears in the autogenerated mode. Is there something that I am missing?

Below given is the code which I am using:
            
mainGrid.MasterTableView.EditMode =GridEditMode.PopUp;   
mainGrid.MasterTableView.EditFormSettings.CaptionDataField ="UnitNumber";  
mainGrid.MasterTableView.EditFormSettings.InsertCaption ="Add new Reading";  
mainGrid.MasterTableView.EditFormSettings.EditFormType =GridEditFormType.Template;  
mainGrid.MasterTableView.EditFormSettings.PopUpSettings.Modal =true;  
mainGrid.MasterTableView.EditFormSettings.FormTemplate = new MyTemplate(); 

Below is the code how I am intializing the grid and GridViewTable
        
mainGrid = new RadGrid();  
mainGrid.AutoGenerateColumns =false;   
mainGrid.AllowSorting =true;  
mainGrid.AllowMultiRowSelection =false;  
mainGrid.ShowStatusBar =true;   
mainGrid.AllowPaging =true;   
mainGrid.AllowAutomaticUpdates =false;  
mainGrid.GridLines =GridLines.None;  
mainGrid.PagerStyle.Mode =GridPagerMode.NumericPages;  
mainGrid.MasterTableView.AllowMultiColumnSorting =true;  
string[] strDataKey ={"UnitNumber"};  
mainGrid.MasterTableView.DataKeyNames =strDataKey;   
gtview.CommandItemDisplay=GridCommandItemDisplay.Top;  
gtview.CommandItemTemplate = new Template();  
gtview.DataKeyNames =strDataKey;  
mainGrid.MasterTableView.DetailTables.Add(gtview); 
Any help would be appreciated.


Regards,
Rakesh

1 Answer, 1 is accepted

Sort by
0
rakesh menon
Top achievements
Rank 1
answered on 25 Mar 2010, 03:52 PM
I used a Web User control instead of the custom Template and it works fine for me. Also one more thing I was missing was I was adding the edit form to the Main Grid instead of the GridView Table.

Thanks,
Rakesh
Tags
Grid
Asked by
rakesh menon
Top achievements
Rank 1
Answers by
rakesh menon
Top achievements
Rank 1
Share this question
or