|
Arjit,
Did you contact ComponentOne tech support?
From what I can gather, you want the columns selected in the ListBox to show up in the grid, correct?
I would handle the item selected event in the ListBox and in code add the column to the grid in code. You probably want to put a button or a checkbox in each item in the ListBox so to make it easier for the user to use your solution.
Sorry, but I don't have the ComponentOne grid.
I hope this helps.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thanks Karl
You have analysed the problem correctly.
I have already contacted ComponentOne tech support.
Regards
Arijit
|
|
|
|
|
Hi Karl,
I have run the program , but it is giving 2 errors.
i)Could not create an instance of type'StaticExtension'
ii)Cannot find the type 'VisibilityToBoolConverter'
I am sending the relevant XAML code as well as the VisibilityToBoolConverter.vb code
<XAML>
<CheckBox IsChecked="{Binding Visibility ,
Converter={x:Static local:VisibilityToBoolConverter.Default},
Mode=TwoWay}"/>
<TextBlock Text="{Binding Caption}"/>
</XAML>
<VisibilityToBoolConverter.vb>
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Windows.Data
Imports System.Windows
Imports System.Globalization
Namespace NEW_WpfApplication_20_5_08
Public Class VisibilityToBoolConverter
Implements IValueConverter
Public Shared ReadOnly [Default] As New VisibilityToBoolConverter()
Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
If TypeOf value Is Visibility Then
Return CType(value, Visibility) = Visibility.Visible
Else
Return Binding.DoNothing
End If
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
If TypeOf value Is Boolean Then
Return If(CBool(value), Visibility.Visible, Visibility.Collapsed)
Else
Return Binding.DoNothing
End If
End Function
End Class
End Namespace
</VisibilityToBoolConverter.vb>
Could you please point out the error in my application ?
Regards
Arijit
|
|
|
|
|
Iam new to WPF ..I have Binded the grid using List View Control..I want to edit the datagrid..How to use template column in grid and edit
|
|
|
|
|
nandiniks wrote: Iam new to WPF
Since WPF is new to you, the easiest way is to download the FREE Infragistics xamDataGrid control.
Later this year, Microsoft will put the DataGrid in WPF, but for now, go the easy route.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
thanks mr Karl for this advice
but i have many problems with XamDataGrid :
I didn't find any complete Guid for it i read the Guid that came with control
but I'm still have big problems .
so is there any sample or guid specially for hierarchy data and how to customize the xamdatagrid
to not display all tree objects
thanks alot
--- i'm very begginer in WPF and this make my mission more complicated ---
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
I don't think the XamDataGrid supports the display of hierarchical data.
The WPF TreeView support hierarchical data with no problem.
What are your trying to achieve?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
XamDataGrid Support hierarchical Data I'm sure
And I tried that
I asked About Any complete Guide for this control To achieve the following :
I have class [A] that contain many collection properties
I assigned collection of class [A] to Data source of XamDataGrid
Then this control displayed automatically all objects from parent and displayed nested rows for each collection
property
I'm looking for Customize this behavior like displaying one collection property as a result on nested rows
and 2 tier Grid
-- thanks ---
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
TreeViewItem.MouseDoubleClick fires three times after a double click.
I want to handle it just once. How can I do this?
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
This event fires for all parents of a certain treeviewitem. So if an item is on level n, then the event will fire n times.
Solution:
if (e.Source == tree.SelectedItem)<br />
DoSomething();
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
gajatko wrote: This event fires for all parents of a certain treeviewitem
The event bubbles up through the tree, but how were you getting all the events
at one handler?
Just curious
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
This way:
TreeViewItem item;
item.MouseDoubleClick += ...;
parentNode.Items.Add(item);
Rather standard procedure, isn't it? Or maybe it's another WTF WPF strange feature.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
So a parent item gets all of its child items' events, right?
What if the target item marks the event as handled?
gajatko wrote: Rather standard procedure, isn't it?
I'm asking you I'm wondering if I'm not understanding something correctly here.
Thanks,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Here is a complete code:
private void AllToUI(MenuNode node, ItemCollection items)
{
foreach (MenuNode subNode in node.Nodes) {
NodeToUI(node, items);
if (subNode.Nodes.Count > 0)
AllToUI(subNode, items);
}
}
private void NodeToUI(MenuNode node, ItemCollection items)
{
TreeViewItem item = new TreeViewItem();
StackPanel itemContent = new StackPanel() {
Orientation = Orientation.Horizontal
};
item.Header = itemContent;
if (node.GetBitmap() != null)
itemContent.Children.Add(new Image {
Height = 20,
Source = node.GetBitmap()
});
Label content = new Label { Content = node.Header };
if (!System.IO.File.Exists(node.File))
content.Foreground = Brushes.Gray;
itemContent.Children.Add(content);
items.Add(item);
item.Expanded += new RoutedEventHandler(item_Expanded);
item.MouseDoubleClick += new MouseButtonEventHandler(item_MouseDoubleClick);
item.Tag = node;
}
void item_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (treeMenu.SelectedItem == e.Source) {
e.Handled = true;
packLaunch();
}
}
In fact this also doesn't work because after packLaunch(); a new window appears behind the main window, which is unacceptable.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
I want to know how to bind the data in the grid using listview control.
|
|
|
|
|
That's a fairly broad question, and not easily answered based on the level of detail in your statement (it's not really a question). Have a look at this[^] article and this[^] one.
|
|
|
|
|
Using silverlight, I need to display a world map. I should display the name of the country on keeping the mouse pointer over the country. Can anyone please help me? For example similar to this: http://whos.amung.us/maps/54u1eg18/textbook/default-orange
|
|
|
|
|
|
|
|
Good People,
I have created a custom listbox (via editing/creating my template for it). I do this via the build .dll option at start up in Expression Blend. When I use it in a project, if I resize it, everything flies apart or gets squished into each other (resizing larger or smaller respectively).
How do I make it stay together as one unit collectively so that upon resizing, it stays together?
Also, in my custom listbox, I added a listbox item and created a template for it. Alas, how do I access the custom listitem that I used the template to create? How do I bind data to it (from a CLR object)? For example, the custom list item has several labels and an image I need to change based upon what it's reading. Do I access it via procedural code (i.e. C#)? I tried, I found the custom control (i.e. this.CustomListBox), however I was unable to access any of it's content (i.e. title label and the list item box and its contents).
Thanks for any help or information you can provide.
BP
modified on Sunday, May 11, 2008 10:55 AM
|
|
|
|
|
To make sure that the resizing behaviour is correct, you should try resizing your template in blend and seeing how it behaves. Make sure that the columns and rows in the grid are setup correctly, and that the objects have the right column, row, columnspan, rowspans and margins. Double click the grid to enable row/column editing.
You can do the data binding in blend, in the project tab there are buttons to add a new data source. However I reccomend to check out the data binding documentation. As well as the articles here on code project.
Also you might want to post a bit more such as your DataTemplate the object it is for and the collection that is bound, if you have any more questions.
|
|
|
|
|
Hi,
I am creating a combo box, the database field is a binary with a true or false value.
I have to convert this and show "Lock" if the value is "true" and Unlock if the value is "False".
How do I do it with the databinding,
To begin with, I created an array,
private string[] binaryOnOffText = new string[2] { "Lock", "UnLock" };
public string[] BinaryOnOffText
{
get
{
return this.binaryOnOffText;
}
set
{
this.binaryOnOffText = value;
OnPropertyChanged("BinaryOnOffText");
}
}
And in my xaml I have used the booleantoIndexConverter,
<ComboBox ItemsSource="{Binding Path=BinaryOnOffText}" SelectedIndex="{Binding Path=OpenOnExitReq, Converter={StaticResource booleanToIndexConverter}}" >
</ComboBox>
public class BooleanToIndexConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
bool boolValue = System.Convert.ToBoolean(value, CultureInfo.InvariantCulture);
if (boolValue)
return (int)1;
return (int)0;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
#endregion
}
The binding does not work when I create the dialog(when I get the selection on the Lock irrespective of whatever value is saved), it work otherwise.
Am I missing something?
Thanks In Advance
|
|
|
|
|
Comboboxes has two sets of bindings.
One to get the data into the combobox.
The other to bind the SelectedValue of the combobox.
You need to databind the SelectValue property. Read up on this property and it will all fall into place.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
How do i read up on this selectedvalue property?
|
|
|
|