We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How can I programmatically add itemtemplates to a gridcolumndescriptor

Hi,

I wish you to programmatically build a tabledescriptor. with Hyperlink columns.

How can I do this ?

7 Replies

VA Valli Syncfusion Team June 5, 2007 07:42 AM UTC

Hi Ryan,

Herewith I have attached a sample which helps you to achieve your requirement.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-61882/main.htm

The above sample programmatically adds a 'Hyperlink' column by using the 'QueryCellStyleInfo' event.

Please try running the sample and let us know if it helps you.

Regards,
Valli


YY Yarius Yacinus July 17, 2007 04:09 PM UTC

Hi,
Your code is working well ,but I would like to know how to open the link in new page .In fact my hyperlink.url="P:\\China Everbright.doc" wich is not a web page like in your exmple.
Thank you in advance

Yacinus


VA Valli Syncfusion Team July 18, 2007 06:34 AM UTC

Hi Yacinus,

Below attached sample helps you to open the hyperlink in a new page.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum_61882_1/main.htm

Instead using the 'NavigateUrl' property, an client-side event which is called when the hyperlink is clicked opens the window in a new page.

Please try running the sample and let us know if this helps you.

Regards,
Valli


YY Yarius Yacinus July 18, 2007 04:15 PM UTC

Hi valli,

thank you for your answer,it works very well,but I have another a question ,if it is possible to have hyperlinks in each row which not refer to the same Url? (same page )

Regards,
Yacinus


VA Valli Syncfusion Team July 19, 2007 04:52 AM UTC

Hi Yacinus,

Thank you for your update.

Below is the sample link which helps you to add hyperlinks to the Grid Grouping control which helps you to navigate different url.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-61883-2/main.htm

In the 'QueryCellStyleInfo' function you can check the rowindex and assign the different url strings.

Please let us know if this helps you.

Regards,
Valli


YY Yarius Yacinus July 20, 2007 08:53 AM UTC

Hi Valli ,

Thanks for you response.Actually I would like to know how to add column in my GGC wich contains a button (save button or linkbutton) ,and how to handle the clicked button event (for example when clicked ,I have to save all row values in my data base )
Thank you in advance
Regards,
Yacinus


VA Valli Syncfusion Team July 23, 2007 08:39 AM UTC

Hi Yacinus,

Thank you for your update.

Attached is a sample which uses '' to add a 'Button' to the column of the Grid Grouping control which handles the click event.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-61883-3/main.htm

The client side and server side function of the button are triggered respectively on the click event.

The server side functions in the sample helps you to retrieve the rows of the Grid Grouping control. Similarly you can save the row value in the database on the click event of the button.

Please let us know if this helps you.

Regards,
Valli


Loader.
Live Chat Icon For mobile
Up arrow icon