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

Develop Itemplate class to support icons in expand column

8 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vikas gupta
Top achievements
Rank 1
vikas gupta asked on 10 May 2012, 11:13 AM


how can i Develop Itemplate class to support icons in expand column.


Thanks

8 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 15 May 2012, 10:57 AM
Hi Vikas,

Thank you for contacting us.

One possible approach is to replace the default Expand/Collapse column with a GridTemplateColumn and implement to it the expand/collapse functionality by firing expand/collapse command . Another approach would be to change the icons of the column by applying custom image to them, which is described in the following articles:
Change Icon 1
 Change Icon 2

I hope this helps. Let me know if you have further requirements or questions.

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
vikas gupta
Top achievements
Rank 1
answered on 24 May 2012, 01:34 PM
Thanks alot Telerik  Team.


Can we add two images in grid Expand columns and one image work for Expand the column and 2nd image work for open the context men menu.

Is it possible or not.

If it is possible can you send me any demo or suggest me way to do.

It is urgent please ,i shall be very thankful to you.


Thanks Telerik support Team.
0
vikas gupta
Top achievements
Rank 1
answered on 24 May 2012, 02:54 PM
Thanks Telerik team

I have one more question  how can i
firie expand/collapse command.can you give me any sample demo Link.



Thanks Telerik Team
0
Shinu
Top achievements
Rank 2
answered on 25 May 2012, 07:27 AM
Hello Vikas,

You can hook the ItemCommand event and check for the CommandName as shown below.
C#:
protected void RadGrid2_ItemCommand(object sender, GridCommandEventArgs e)
 {
    if (e.CommandName == RadGrid.ExpandCollapseCommandName)
    {
    }
}

Thanks,
Shinu.
0
vikas gupta
Top achievements
Rank 1
answered on 25 May 2012, 07:49 AM
Thanks Shinu


Please reply for my below question.

Can we add two images in grid Expand columns and one image work for Expand the column and 2nd image work for open the context men menu.


Is it possible or not?

If it is possible can you send me any demo or suggest me way to do.?

It is urgent please ,i shall be very thankful to you. 

I hope you will reply soon,we have to give answer to our client is it possible or not?
0
Eyup
Telerik team
answered on 29 May 2012, 11:19 AM
Hi Vikas,

I have created a sample RadGrid page implemented with the desired functionality. Please check it out and let me know if have any other requirements.

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
vikas gupta
Top achievements
Rank 1
answered on 03 Jun 2012, 06:41 AM
Hello Telerik team

1) We are using below code for adding image button control in expand/collapse column with which we will able to add control on parent grid not in nested child girds under that  we are making dynamic nested grid loading data in javascript funtions.
 
        protected void rgMainGrid_PreRender(object sender, EventArgs e)
        {
           AddControlToExpandColumn(rgMainGrid.MasterTableView);
            
        }

        public void AddControlToExpandColumn(GridTableView tableView)
        {
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
            {
                TableCell cell = nestedViewItem.ParentItem["ExpandColumn"];
                ImageButton contextButton = new ImageButton();
                contextButton.ImageUrl = "/_layouts/IDFRiskWebPart/Images/downarrowImg.jpg";
                contextButton.OnClientClick = "showAreaMenu(event);";
                cell.Controls.Add(contextButton);
                cell.Width = Unit.Pixel(35);
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
                {
                    TableCell cells = nestedView.ParentItem["ExpandColumn"];
                    ImageButton contextButton1 = new ImageButton();
                    contextButton1.ImageUrl = "menu.png";
                    contextButton1.OnClientClick = "showAreaMenu(event);";
                    cells.Controls.Add(contextButton1);
                    cells.Width = Unit.Pixel(35);

                }
                
               
            }
}

Thanks and Regards
Vikas
0
Eyup
Telerik team
answered on 06 Jun 2012, 02:48 PM
Hi Vikas,

It is difficult to figure out your exact requirement by the provided code and information so far. Could you please elaborate some more on the issue?

It would be best if you open a support ticket and send us a runnable sample application containing the mark-up of the page and the related code-behind. Thus, we will be able to further analyze your project and provide a proper solution.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
vikas gupta
Top achievements
Rank 1
Answers by
Eyup
Telerik team
vikas gupta
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or