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

GridDataBoundGrid LinkLabel cell

Hi there, I have a databound grid to which I have added to the GridBoundColumn collection an item of cellType LinkLabelCell. I set the mapping name and the hyperlink shows correctly within the grid. My problem is that I do not want to show the hyperlink text. I want something similar to the LinkLabelCells example: gridControl1(rowIndex, 2).CellType = "LinkLabelCell" gridControl1(rowIndex, 2).Text = "Windows Forms FAQ" gridControl1(rowIndex, 2).Tag = "http://www.syncfusion.com/FAQ/WinForms" whereby the label "Windows Forms FAQ" is shown and when clicked it goes to the hyperlink "http://www.syncfusion.com/FAQ/WinForms" Thanks Iain

4 Replies

AD Administrator Syncfusion Team December 2, 2004 03:41 AM

I thnk you will have to handle the grid.Model.QueryCellInfo event. In the handler, if e.RowIndex > 0 && e.ColIndex points to your linklabel column, then explicitly set e.Style.Text and e.Style.Tag to be what you want. You can probably use the initial setting of e.Style.Text to decide which link you need to put back into e.Style.Text and e.Style.Tag.


IA Iain December 2, 2004 05:17 AM

Hi, Thanks for the quick reply. It''s my 1st day working on the grid so I may have got things wrong but I can''t seem to find the grid.model.QueryCellInfo event. Does this exist on the DataBoundGrid? Thanks Iain >I thnk you will have to handle the grid.Model.QueryCellInfo event. In the handler, if e.RowIndex > 0 && e.ColIndex points to your linklabel column, then explicitly set e.Style.Text and e.Style.Tag to be what you want. You can probably use the initial setting of e.Style.Text to decide which link you need to put back into e.Style.Text and e.Style.Tag.


AD Administrator Syncfusion Team December 2, 2004 06:37 AM

Yes. It is a member of the Model object, not the grid directly. So, to subscribe to it you use, //C# this.grid.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(model_QueryCellInfo); ''VB AddHandler Me.grid.Model.QueryCellInfo, addressof model_QueryCellInfo


IA Iain December 2, 2004 06:57 AM

Thanks... It works a treat

Loader.
Live Chat Icon For mobile
Up arrow icon