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

[Solved] How to add Fileupload control to radgrid columns dynamically

4 Answers 315 Views
Grid
This is a migrated thread and some comments may be shown as answers.
feroz minnadad
Top achievements
Rank 1
feroz minnadad asked on 24 Sep 2009, 09:56 AM

Hi,

I am Feroz. I am using telerik radgrid for my application. I need to add fileupload control dynamicaly to columns in radgrid.

Please give any suggestions.

Thanks in advance.

Regards
Feroz

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Sep 2009, 10:26 AM
Hello Firoz,

You can try out the following code to add an upload control dynamically to a template column:
aspx:
<telerik:GridTemplateColumn UniqueName="TemplateColumnUniqueName" HeaderText="Upload"
  <ItemTemplate> 
       
  </ItemTemplate> 
</telerik:GridTemplateColumn> 

c#:
 protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem gridItem = (GridDataItem)e.Item; 
            FileUpload upload = new FileUpload();             
            upload.ID = "FileUpload1"
            gridItem["TemplateColumnUniqueName"].Controls.AddAt(0, upload); 
        } 
    } 

Thanks
Princy.
0
feroz minnadad
Top achievements
Rank 1
answered on 24 Sep 2009, 10:44 AM
Hi Princy,

Thanks for replying,

For me the RadGrid control itself has to be created in the code behind file(dynamically).
So please help me


Thanks
M.S. Feroz.
0
Accepted
Princy
Top achievements
Rank 2
answered on 24 Sep 2009, 10:58 AM
Hi Feroz,

Check out the following help document to understand how to create the grid programatically or add Template columns programatically and add controls to the template column:
Programmatic creation

Regards
Princy.



0
feroz minnadad
Top achievements
Rank 1
answered on 24 Sep 2009, 11:08 AM
Hi Princy,

Thanks for your suggestion.

But I had already created radgrid dynamically. I need to add a fileupload control dynamically to that dynamically created radgrid columns.

So Please give any suggestions.

Regards
Feroz



Tags
Grid
Asked by
feroz minnadad
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
feroz minnadad
Top achievements
Rank 1
Share this question
or