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

show save dialogue when the link button is clicked in grid

0 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 08 Jun 2012, 02:13 PM
Hi There,

I am trying to show a link button using GridButtonColumn. I've got two problems here.

[1] I need to get data from database and update this GridButtonColumn at run time.
     For this I am using linq to sql and getting the data from database. but in the example below from Telerik site, row value is not constant (Release column) for all columns which is not in my case. Each row will have different name.

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx 

<telerik:RadGrid ID="RadGrid1" OnSortCommand="RadGrid1_SortCommand" OnPageIndexChanged="RadGrid1_PageIndexChanged" 
            Width="97%" OnPageSizeChanged="RadGrid1_PageSizeChanged" OnItemDataBound="RadGrid1_ItemDataBound"
             AllowSorting="True" PageSize="15" AllowPaging="True" runat="server" Gridlines="None" AutoGenerateColumns="False">
             <MasterTableView Width="100%">
             <Columns>
                <telerik:GridButtonColumn DataTextFormatString=""
                        UniqueName="Subject" HeaderText="Subject" DataTextField="">
                    </telerik:GridButtonColumn>
                <telerik:GridBoundColumn UniqueName="dc1" HeaderText="DC1" DataField="dc1">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="dc2" HeaderText="DC2" DataField="dc2">
                </telerik:GridBoundColumn>        
             </Columns>
             </MasterTableView>
             <PagerStyle Mode="NextPrevAndNumeric" />
            </telerik:RadGrid>

Backend:

var docs = from d in dbo.abc1
                       join p in dbo.abc2 on d.id equals p.Id
                       join c in dbo.abc3 on p.cId equals c.Id
                       select new
                       {
                           d.filelink, 
                           d.dc1,
                           d.dc2
                       };
            RadGrid1.DataSource = docs;
            RadGrid1.DataBind();


[2] When the user clicks this above link button they should get open/save dialogue.

Can you just let me know whether this can be done using RadGrid control?

Thanks,
Sunny

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Sunny
Top achievements
Rank 1
Share this question
or