Solved

Windows.Forms.Datagrid - Hyperlink Column: How to?

Posted on 2004-09-16
7
617 Views
Last Modified: 2010-07-27
Hi, I am coding a Hyperlink column for the Windows.Forms.Datagrid as follows:

I have derived from System.Windows.Forms.DataGridTextBoxColumn
I have overridden the paint method
I have a LinkLabel that I can use.

Now then, not worring too much about the value of the url, how do I access the cells value and paint the LinkLabel?
I presume that I can use 'this.TextBox.Text' to get the value - is this correct?

Thanks.
0
Comment
Question by:Daeljan
  • 3
7 Comments
 
LVL 10

Expert Comment

by:123654789987
ID: 12073760
U can try this
link

http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q888q

Search for "How do I display a column of buttons such as pushbuttons or combobox buttons? "

U can use pushbuttons as linkbutton

0
 
LVL 2

Author Comment

by:Daeljan
ID: 12075021
How do I use push buttons as a link button?

The examples displayed are drawing bitmaps of buttons to the screen. Given that a LinkLabel has a specific look and behaviour, I don't want to redesign the wheel and emulate it, I just want to use it.

Any ideas?

Thanks.
0
 
LVL 2

Author Comment

by:Daeljan
ID: 12216355
I would like to close this question as I have solved the problem myself, and I have it all working as I wanted.

To make a custom column of any kind, create a new column type based on System.Windows.Forms.DataGridColumnStyle.
This column should maintain an array of controls of the type you want to display.
You have to add each control in the array of controls to the new column (in a loop):
DataGridTableStyle.DataGrid.Controls.Add(_controlArray[i]);

In the paint method you can set properties for each control:
LinkLabel linkLabel = controlArray[rowNum];
linkLabel.Text = GetColumnValueAtRow(source, rowNum).ToString();

The controls will paint themselves - don't worry about them.

A search in Google for System.Windows.Forms.DataGridColumnStyle will bring up many articles to help.

0
 
LVL 2

Author Comment

by:Daeljan
ID: 12453573
I have posted in the Community support section requesting a refund because I answered my own question.

Regards
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12485277
Question answered by asker or dialog valuable.
Closed, 200 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question