Daeljan
asked on
Windows.Forms.Datagrid - Hyperlink Column: How to?
Hi, I am coding a Hyperlink column for the Windows.Forms.Datagrid as follows:
I have derived from System.Windows.Forms.DataG ridTextBox Column
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.
I have derived from System.Windows.Forms.DataG
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.
ASKER
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.
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.
ASKER
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.DataG ridColumnS tyle.
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.DataGri d.Controls .Add(_cont rolArray[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.DataG ridColumnS tyle will bring up many articles to help.
To make a custom column of any kind, create a new column type based on System.Windows.Forms.DataG
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.DataGri
In the paint method you can set properties for each control:
LinkLabel linkLabel = controlArray[rowNum];
linkLabel.Text = GetColumnValueAtRow(source
The controls will paint themselves - don't worry about them.
A search in Google for System.Windows.Forms.DataG
ASKER
I have posted in the Community support section requesting a refund because I answered my own question.
Regards
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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