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

Some questions about the CommandItem

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thijs van Gestel
Top achievements
Rank 1
Thijs van Gestel asked on 28 May 2010, 10:43 AM
Hello, for my latest assignment, I need to put linkbuttons above certain columns of my radgrid. In my viewpoint, this could best be done by adding these to the commanditem of the grid, but I run into 2 issues with this that I can't seem to find the solution for:

1) Is it possible to add linkbuttons dynamically to the commanditem of the radgrid in the code behind of the .aspx page it is on? I've seen and used examples where you can retreive existing linkbuttons in the itemCreated event by checking for CommandItems there, but with that option you can seemingly only edit the existing items, and not add new ones.

2) Is it possible for commanditems to be alligned to certain columns of the radgrid it belongs to? Since the page my radgrid is on can be resized, I can't just use static spaces to have a commandbutton above a certain column all the time.


1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 02 Jun 2010, 04:11 PM
Hello Thijs,

Indeed, you can custom controls in the grid command item on ItemCreated, just as you can retrieve and change any existing controls there.
In order to achieve your goal, you can define your own CommandItemTemplate containing a table with cells width corresponding to the grid columns. The on ItemCreated add the desired LinkButtons to the specific cells.

I hope this helps.

Sincerely yours,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Thijs van Gestel
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or