Click here to Skip to main content
15,921,351 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Extended EDMX Pin
Pete O'Hanlon6-May-11 7:35
mvePete O'Hanlon6-May-11 7:35 
GeneralRe: Extended EDMX Pin
eddieangel6-May-11 7:38
eddieangel6-May-11 7:38 
GeneralRe: Extended EDMX Pin
Pete O'Hanlon6-May-11 8:23
mvePete O'Hanlon6-May-11 8:23 
GeneralRe: Extended EDMX Pin
eddieangel6-May-11 8:24
eddieangel6-May-11 8:24 
QuestionHow to convert arrayclass into normal class object.. Pin
Rocky236-May-11 7:12
Rocky236-May-11 7:12 
AnswerRe: How to convert arrayclass into normal class object.. Pin
Pete O'Hanlon6-May-11 23:38
mvePete O'Hanlon6-May-11 23:38 
GeneralRe: How to convert arrayclass into normal class object.. Pin
Rocky237-May-11 0:20
Rocky237-May-11 0:20 
GeneralRe: How to convert arrayclass into normal class object.. Pin
Pete O'Hanlon7-May-11 1:34
mvePete O'Hanlon7-May-11 1:34 
QuestionWPF samples Pin
arkiboys6-May-11 2:57
arkiboys6-May-11 2:57 
AnswerRe: WPF samples Pin
Ian Shlasko6-May-11 3:10
Ian Shlasko6-May-11 3:10 
AnswerRe: WPF samples Pin
Renat Khabibulin9-May-11 1:09
Renat Khabibulin9-May-11 1:09 
GeneralRe: WPF samples Pin
arkiboys9-May-11 1:11
arkiboys9-May-11 1:11 
GeneralRe: WPF samples Pin
Renat Khabibulin9-May-11 1:32
Renat Khabibulin9-May-11 1:32 
GeneralRe: WPF samples Pin
arkiboys9-May-11 1:42
arkiboys9-May-11 1:42 
QuestionMake two listboxes have the same width Pin
Jean-Louis Leroy6-May-11 2:43
Jean-Louis Leroy6-May-11 2:43 
AnswerRe: Make two listboxes have the same width Pin
Ian Shlasko6-May-11 3:09
Ian Shlasko6-May-11 3:09 
GeneralRe: Make two listboxes have the same width Pin
Jean-Louis Leroy6-May-11 3:18
Jean-Louis Leroy6-May-11 3:18 
GeneralRe: Make two listboxes have the same width Pin
Ian Shlasko6-May-11 3:31
Ian Shlasko6-May-11 3:31 
GeneralRe: Make two listboxes have the same width Pin
Jean-Louis Leroy9-May-11 1:23
Jean-Louis Leroy9-May-11 1:23 
AnswerRe: Make two listboxes have the same width Pin
Renat Khabibulin9-May-11 1:26
Renat Khabibulin9-May-11 1:26 
Questionselect columns to load Pin
picasso25-May-11 18:49
picasso25-May-11 18:49 
QuestionHow to read the values from listbox Item source Pin
Rocky235-May-11 18:38
Rocky235-May-11 18:38 
HI,

In my application, i have to do something like that, checking the duplicate of data or checking wether the directive name in my listbox data template is empty or not,

Because when the user click on the button to insert new directive it has to check the listbox like wether the directive name is null or not, so can u tell me how to do it..

I have used a code like this,
public void LoadDirective()
        {
            //DerivedAttributeEntity oDAEEntity;
            listdata = new ObservableCollection<DADirective>();            
            SelectDirective = (DADirective)lbDirectiveList.SelectedItem;

            listdata.Add(new DADirective { DirectiveName = "Filter trading account", DirectiveDescription = "Rows will Trading account value to be filtered" });
            listdata.Add(new DADirective { DirectiveName = "Filter Counter party rows", DirectiveDescription = "Rows where counter party is null will be filtered" });
            listdata.Add(new DADirective { DirectiveName = "Filter USD currency records", DirectiveDescription = "Filter those rows where currency is USD" });

            lbDirectiveList.ItemsSource = listdata;
        }

private void btnNewDirectiveClicked(object sender, RoutedEventArgs e)
        {
            gDirectiveDetails.IsEnabled = true;
            gDerivedCondition.IsEnabled = true;
            DADirective dirdata = new DADirective { };
            
                   if (!listdata.Contains(dirdata))
            {
                    if (listdata.Count >= 0)
                    {
                        listdata.Add(new DADirective { });
                        lbDirectiveList.SelectedIndex = listdata.Count - 1;
                        txtDirectiveName.Focus();
                    }
                }
            
        }


This is my xaml code..

<ListBox Grid.Row="1" Grid.Column="2" x:Name="lbDirectiveList" ItemsSource="{Binding}" SelectionChanged="lbDirectiveList_SelectionChanged" MaxHeight="200" SelectionMode="Single" ScrollViewer.VerticalScrollBarVisibility="Auto">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid Margin="4">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="25" />
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>

                                        <TextBlock Name="tbDirName" Text="{Binding Path=DirectiveName, Mode=TwoWay}" Grid.Column="0" FontWeight="Bold" MinWidth="200"/>
                                        <TextBlock Text=" - " Grid.Column="1"/>
                                        <TextBlock Grid.Column="2" Name="tbDirDesc" Text="{Binding Path=DirectiveDescription, Mode=TwoWay}" />
                                    </Grid>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>


so how can to read the data in this listbox, i have used a foreach loop like foreach(var dir in listdata), but it is giving exception in case of directive insert, so is there any other way for this...
AnswerRe: How to read the values from listbox Item source Pin
Thanigainathan.S6-May-11 0:38
Thanigainathan.S6-May-11 0:38 
AnswerRe: How to read the values from listbox Item source Pin
Pete O'Hanlon6-May-11 1:12
mvePete O'Hanlon6-May-11 1:12 
QuestionWPF 3d iges, catpart or step modeling Pin
rafaeltejera5-May-11 11:17
rafaeltejera5-May-11 11:17 

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.