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

[Solved] Do Expand And Collaps with LinkButton

1 Answer 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Farshad heidary
Top achievements
Rank 1
Farshad heidary asked on 09 Feb 2010, 08:03 AM
hi Support team.
i want to Expand And Collaps with Customize Link Button without use ExpandCollapseColumn.
it means wanna implement programatically.
i use this code but dont work
tnx 4 ur attention
protected void HyperCommentShowHide_Click(object sender, EventArgs e) 
    { 
 
     


            LinkButton HyperCommentShowHide = (LinkButton)sender; 
            foreach (GridDataItem dataitem in RadGrid1.MasterTableView.Items) 
            { 
                Response.Write(dataitem.KeyValues); 
                string[] splitedDataItem = dataitem.KeyValues.Split(':'); 
                string[] splitedDataItemFinal = splitedDataItem[1].Split('"'); 
                if (splitedDataItemFinal[1] == HyperCommentShowHide.CommandArgument.ToString()) 
                { 
                    dataitem.Expanded = true
                    break
                } 
 
 
            } 
        } 




    }  


  <asp:LinkButton CommandArgument='<%# Eval("ID") %>'
OnClick="HyperCommentShowHide_Click" ID="HyperCommentShowHide"
runat
="server">LinkButton</asp:LinkButton> 

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 09 Feb 2010, 11:10 AM
Hi,

Take  a  look at the code library below that describes how this can be achieveed. You can manipulate this to suit your scenario.
Custom expand/collapse column with ExpandAll/CollapseAll image button in the header

Thanks,
Shinu
Tags
Grid
Asked by
Farshad heidary
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or