Click here to Skip to main content
15,886,422 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF Editable ComboxBox Question Pin
Kevin Marois16-Sep-12 8:55
professionalKevin Marois16-Sep-12 8:55 
GeneralRe: WPF Editable ComboxBox Question Pin
SledgeHammer0116-Sep-12 9:14
SledgeHammer0116-Sep-12 9:14 
GeneralRe: WPF Editable ComboxBox Question Pin
Kevin Marois16-Sep-12 9:31
professionalKevin Marois16-Sep-12 9:31 
GeneralRe: WPF Editable ComboxBox Question Pin
SledgeHammer0116-Sep-12 10:15
SledgeHammer0116-Sep-12 10:15 
GeneralRe: WPF Editable ComboxBox Question Pin
Kevin Marois16-Sep-12 10:25
professionalKevin Marois16-Sep-12 10:25 
QuestionWPF Datagrid linked to URL Pin
abollmeyer13-Sep-12 18:14
abollmeyer13-Sep-12 18:14 
AnswerRe: WPF Datagrid linked to URL Pin
Pete O'Hanlon13-Sep-12 20:52
mvePete O'Hanlon13-Sep-12 20:52 
GeneralRe: WPF Datagrid linked to URL Pin
abollmeyer13-Sep-12 22:50
abollmeyer13-Sep-12 22:50 
Hi Pete,

Thanks for the response! I am not sure what you are suggesting. I am binding the data from the List into separate columns in my DataGrid. But instead of returning the information in the DataGrid, I want to open a browser window and go to the URL.

It's hard to explain without pictures, but I have a DataGrid with 6 columns. Under column 1, I list a description, with a hyperlink look. I bind the description of the part to that column. When the user clicks on that row, that's when I want to open the browser window. I thought about just using a DataGridHypertextColumn, but every example I could find online used an absolute address (http://exampleaddress.com). I will need to read the address from a textfile database. I suppose I could add another column and bind the URL to its own DataGrid column, but I am trying to avoid that.

Since I can't upload pictures, I have included the code.

private List<addData> LoadCollectionData()
        {
            List<addData> readData = new List<addData>();
            
            //Cannot search by text value of combobox or instant search will be one click behind.
            //Use this code to get "instantaneous" value of combobox text that user has currently selected.
            string searchLine = (machineComboBox.SelectedValue.ToString()).ToUpper();
            string findLine = searchTextBox.Text.ToUpper();
            foreach (string readLine in File.ReadAllLines(path))
            {
                if (readLine.Contains(searchLine) && readLine.Contains(findLine))
                {
                    string[] myData = readLine.Split('|');
            
                    //Add search contents to List array.
                    readData.Add(new addData()
                    {
                        description = myData[0],
                        ICN = myData[1],
                        RIN = myData[2],
                        indexCode = myData[3],
                        location = myData[4],
                        machine = myData[5]
                    });

                    //Here is where I am confused!!!
                    webLink = myData[6];
                    
                }
            }
            return readData;
        }


And here is the XML:

XML
<DataGridTextColumn Header="Part Name" CanUserResize="True" Width="225" Binding="{Binding description}">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="TextBlock">
                            <Setter Property="FontSize" Value="20"/>
                            <Setter Property="FontWeight" Value="Black"/>
                            <Setter Property="TextElement.Foreground" Value="Blue"/>
                            <Setter Property="TextDecorations" Value="Underline"/>
                            <Setter Property="TextWrapping" Value="Wrap"/>
                            <Setter Property="HorizontalAlignment" Value="Stretch"/>
                            <Setter Property="Cursor" Value="Hand"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>


I apologize for being a little slow in understanding what you have explained so far, but I am very new to WPF and DataGrid seems much more complicated than it was in WinForms.
GeneralRe: WPF Datagrid linked to URL Pin
Pete O'Hanlon13-Sep-12 23:23
mvePete O'Hanlon13-Sep-12 23:23 
GeneralRe: WPF Datagrid linked to URL Pin
abollmeyer14-Sep-12 21:42
abollmeyer14-Sep-12 21:42 
QuestionUN Register Scriptable Object Pin
Marc Vandeputte13-Sep-12 7:07
Marc Vandeputte13-Sep-12 7:07 
AnswerRe: UN Register Scriptable Object Pin
Clifford Nelson13-Sep-12 8:34
Clifford Nelson13-Sep-12 8:34 
GeneralRe: UN Register Scriptable Object Pin
Marc Vandeputte13-Sep-12 10:41
Marc Vandeputte13-Sep-12 10:41 
GeneralRe: UN Register Scriptable Object Pin
Clifford Nelson13-Sep-12 11:19
Clifford Nelson13-Sep-12 11:19 
QuestionWCF error - CommunicationException: Error in deserializing body of reply message for operati Pin
vanikanc12-Sep-12 15:33
vanikanc12-Sep-12 15:33 
QuestionWpf Datagrid Pin
sudeep kushwaha12-Sep-12 2:38
sudeep kushwaha12-Sep-12 2:38 
AnswerRe: Wpf Datagrid Pin
Pete O'Hanlon12-Sep-12 3:03
mvePete O'Hanlon12-Sep-12 3:03 
GeneralRe: Wpf Datagrid Pin
SledgeHammer0112-Sep-12 11:55
SledgeHammer0112-Sep-12 11:55 
AnswerRe: Wpf Datagrid Pin
Clifford Nelson12-Sep-12 12:19
Clifford Nelson12-Sep-12 12:19 
GeneralRe: Wpf Datagrid Pin
SledgeHammer0112-Sep-12 12:27
SledgeHammer0112-Sep-12 12:27 
AnswerRe: Wpf Datagrid Pin
Clifford Nelson12-Sep-12 12:34
Clifford Nelson12-Sep-12 12:34 
GeneralRe: Wpf Datagrid Pin
SledgeHammer0112-Sep-12 13:29
SledgeHammer0112-Sep-12 13:29 
QuestionWPF groupbox visibility by combobox value selected Pin
karthik bandaru11-Sep-12 20:33
karthik bandaru11-Sep-12 20:33 
AnswerRe: WPF groupbox visibility by combobox value selected Pin
Mycroft Holmes11-Sep-12 20:54
professionalMycroft Holmes11-Sep-12 20:54 
GeneralRe: WPF groupbox visibility by combobox value selected Pin
karthik bandaru11-Sep-12 21:04
karthik bandaru11-Sep-12 21:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.