Hai all,
I need to insert a link label inside a grid. Is it possible to do that. The problem is the link data is going to be fed by a database and the link lable should come at the first column of the grid. Is there any way to do that. Please help with some code samples if possible. Thank you in advance for all your help.
You could set the Style property of the column to FormattedText, then set the column.Header.VisiblePosition to 0 to make sure that it's the first visible column. Your best bet would be to do this in the InitializeLayout event:
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e){ UltraGridColumn column = e.Layout.Bands[0].Columns[0]; column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.FormattedText; column.Header.VisiblePosition = 0;}
-Matt
I'm not able to get a link label appearence with this approach. Is there any changes i should make in the code. And also Could you help me how i could handle the event on some mouse click and others. Cause i'm new to infragistics controls. Thank u so much for your help.
In this case you could use a standalone UltraFormattedLinkLabel and assign it as the EditorControl of the column instead of assigning the Style. At this point, you should be able to handle the LinkClicked event.
Am able to capture the link click in the link clicked event but it comes with two problems
1. I'm not able to capture from which cell from which cell i got this event click.
2. If I'm having same values in more than one cell in the column i'm having the link on the click one of the link the other link also turns purple.
Is there any way to solve my problems. Please advice. Thank you very much.
thanks mike for ur reply. I've handled it in the way you told. i jus want the text alone to be as link. So used the control.
BTW.. if you want text and a link in the cell, then the way you are doing it is correct. If you want the entire cell to be a link, then you could just set teh Style of the column to URL.
Anyway, I don't think LinkClicked gives you a mouse button. So you would have to trap the MouseDown event on the grid and simply record the last mouse button that was used in a variable.
Is it possible to get which mouse button is clicked in the linkclicked event?
Since you have the actual UltraGridCell through the Context, you'll be able to get the row, and thus the value of the other cells.
Okie. I'm not sure if thats gonna bring any problem. But thank you so much matt for all your help. Just tell me one thing will i be able to classify the data from each cell even though i have same value in them by the context value in the linkclicked event?