I have a ListView in which one of the column contains combo box.
I have binded the selectedItem of a Listview, so that I get the current object (selected row ) in the listview.
When I do any operation in a combo box like selection change then the listview row ( in which that combo box belongs) is not selected be default and hence my selectedItem gives null or previous row selected object.
Please Help!!
We just recently upgraded all our code base to .net 4.0, and are trying to build custom actions in our installer using .net 4.0.
We are using wix 3.5 to do that, I am getting BadImageException, saying its built using a newer version of .net runtime than currently loaded.
does wix 3.5's makesxca utility support .net 4.0 ?
Hi Friends,
I have one query in which I really stuck at that. I have port database with waypoints and also routing points which I need to use in distance calculation between two ports. I have done lots of R&D to find formula which gives me distance between two points. I also need shortest route which is possible.
I have reviewed online tools which allow user to calculate the distance. But I want to do the same at my own. I have reviewed Port World Distance Calculator. I reviewed the Great Circle formula to achieve that but I don't know that how we avoid landscapes in sea distance and in which direction I need to find distance for second port.
I have ListView control in my application which is binded to the collection of CustomObject List<CustomObject. The CustomObject has seperate view. This ListView has seperate view model.
The collection List _customobject is containted in the ListView ViewModel class.
My Query:
I want to invoke a view that show properties of custom object, when user double click on any row of ListView. The ListView double click command is binded to the ListViewDoublClick Command in the view model. The CustomObject is in the event argument of listview double click command. To acheive this I have to pass the custom object ( or an unique id property of custom object through which I can retrieve the custom object from the collection) as command parameter.
Please suggest me the solution!!
I have several dialogs in the application. I want to pop up help related box when user clicks on the help button next to Main Heading.
The help box is activated by selecting the small blue icon next to the heading. When the help box appears it has the information that is required to understand the entry related to the dialog.
This help box automatically disappears when user clicks any where other then the help box.
Please help!!
I have a simple requirement as mentioned below:
A ListView or any control displays list of bitmaps/images. When user mouse hovers on any bitmap that bitmap zoomed to show that is currently selected.
Since I have to provide drag drop operations and click operation that why I taken the list view.
Pleas help!!
It will be great if any body provide the xaml to this..
I have a List View in which I have defined a custom cell as a user control.
In the custom cell I given user hyperlink, I am showing a WPF dialog when user clicks on a hyperlink.
I want WPF dialog comes just above the hyperlink..
Please let me know how can I acheive this or how to set the location of the dialog so that it just comes above the hyperlink.
I recently read an article about duck-typing.It said about calling functions of different classes using object of any class.
Is it true?And how will the compiler do it on runtime?
I apologize if i am not clear.But it really fascinates me , if we could do it dynamically.
So if u people got any idea.I am all ears.
thank you!!
how will the function be accessed by object of any other class. that violates the basic principle of OOP.and that too dynamically during runtime. And is this feature possible in case of OOP languages?
this is the code for menu CSS code. It will work on Firefox but not in IE6.
.menu li a:hover .menu ul li:hover a{
background-image:url(images/ye.jpg);
color:#000000;
text-decoration:none;
}
I have a enum let's say
enum MyEnum
{
FirstImage,
SecondImage,
ThirdImage,
FourthImage
};
I have binded this Enum to my combobox in XAML.
While defining an combobox I have defined an ItemTemplate of combox to take Two UI element:
TextBlock that show the enum value (Description)
Image
I have done this much in XAML.
I am wondering where I can specify the Image corrosponding to each item of Enum value in a combobox? Is that possible through data trigger ?
I really appreciate if anyone have the XAML for this scenario.
Many Thanks in advance
I have a Datatable with Id(guid) and Name(string) columns. I traverse through the data table and run a validation criteria on the Name (say, It should contain only letters and numbers) and then adding the corresponding Id to a List If name passes the validation.
Something like below:-
List<Guid> validIds=new List<Guid>();
foreach(DataRow row in DataTable1.Rows)
{
if(IsValid(row["Name"])
{
validIds.Add((Guid)row["Id"]);
}
}
In addition to this validation I should also check If the name is not repeating in the whole datatable (even for the case-sensitiveness), If It is repeating, I should not add the corresponding Id in the List.
Things I am thinking/have thought about:-
1) I can have another List, check for the "Name" in the same, If It exists, will add the corresponding Guild
2) I cannot use HashSet as that would treat "Test" and "test" as different strings and not duplicates.
3) Take the DataTable to another one where I have the disctict names (this I havent tried and the code might be incorrect, please correct me whereever possible)
DataTable dataTableWithDistinctName = new DataTable();
dataTableWithDistinctName.CaseSensitive=true
CopiedDataTable=DataTable1.DefaultView.ToTable(true,"Name");
I would loop through the original datatable and check the existence of the "Name" in the CopiedDataTable, If It exists, I wont add the Id to the List.
Are there any better and optimum way to achieve the same? I need to always think of performance. Although there are many related questions in SO, I didnt find a problem similar to this. If you could point me to a question similar to this, It would be helpful.
Thanks
How Dispatcher concept in .NET 3.5 in WPF differs from the background thread in .NET 2.0 ?
For example what will be difference between statements below:
delegate.Invoke/BeginInvoke AND this.dispatcher.Invoke/BeginInvoke
I have a Enum defined as Type
public Enum Type
{
OneType,
TwoType,
ThreeType
};
Now I bind Type to a drop down Ribbon Control Drop Down Menu in a Ribbon Control that displays each menu with a MenuName with corresponding Image.
( I am using Syncfusion Ribbon Control ).
I want that each enum type like ( OneType ) has data template defined that has Name of the menu and corrospending image.
How can I define the data template of enum ?
Please suggest me the solution, if this is possible !!
Please also tell me if its not possible or I am thinking in the wrong direction !!
I have a ListView that is binded to my custom collection.
At run time , I am updating the certain properties of my entity in my custom collection in my ViewModel. At the same time , I am also doing the custom sorting in the listview.
The custom sorting is applicable when I click on the any column header of the listview.
For example, I am updating the current datetime on my entity on every 5 seconds and simulaneously , I am applying custom sorting based on DateTime.
(The Listview is third party control).
Hence I am doing two operations on my custom collection at the same time.
Should I pass the dispatcher of my control in the view model and call any methods ( which updates any entity in my custom collection ) through UI dispatcher ?
Hello,
I have a simple test using vsts load test that is using datasource. The connection string for the source is as follows
<connectionStrings>
<add name="MyExcelConn" connectionString="Driver={Microsoft Excel Driver (*.xls)};Dsn=Excel Files;dbq=loginusers.xls;defaultdir=.;driverid=790;maxbuffersize=4096;pagetimeout=20;ReadOnly=False" providerName="System.Data.Odbc" />
</connectionStrings>
the datasource configuration is as follows
and i am getting following error
estError TestError 1,000 The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.
Error details: ERROR [42000] [Microsoft][ODBC Excel Driver] Cannot update. Database or object is read-only.
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
ERROR [42000] [Microsoft][ODBC Excel Driver] Cannot update. Database or object is read-only.
I wrote a test, just to check if i could create an odbc connection would work and that works
the test is as follows
[TestMethod]
public void TestExcelFile()
{
string connString = ConfigurationManager.ConnectionStrings["MyExcelConn"].ConnectionString;
using (OdbcConnection con = new OdbcConnection(connString))
{
con.Open();
System.Data.Odbc.OdbcCommand objCmd = new OdbcCommand("SELECT * FROM [loginusers$]");
objCmd.Connection = con;
OdbcDataAdapter adapter = new OdbcDataAdapter(objCmd);
DataSet ds = new DataSet();
adapter.Fill(ds);
Assert.IsTrue(ds.Tables[0].Rows.Count > 1);
}
}
any ideas ?
Hi,
I am trying to open the combobox popup when it is focused using Style/Event Trigger
I used the following code in my Combobox control Template:
<ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
<Grid >
<ToggleButton Grid.Column="2" Template="{DynamicResource ComboBoxToggleButton}" x:Name="ToggleButton" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"/>
<ContentPresenter HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="ContentSite" VerticalAlignment="Center" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" IsHitTestVisible="False"/>
<TextBox Visibility="Hidden" Template="{DynamicResource ComboBoxTextBox}" HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="PART_EditableTextBox" Style="{x:Null}" VerticalAlignment="Center" Focusable="True" Background="Transparent" IsReadOnly="{TemplateBinding IsReadOnly}"/>
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
<Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
<Border x:Name="DropDownBorder" Background="{DynamicResource ShadeBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1"/>
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
**<Trigger Property="IsMouseOver" Value="True">
<Setter Property="IsOpen" Value="True" TargetName="Popup"/>
</Trigger>**
</ControlTemplate.Triggers>
</ControlTemplate>
But nothing happens with this code.
So I trid the following Event trigger in ControlTemplate.Triggers
<EventTrigger RoutedEvent="UIElement.GotFocus">
<BeginStoryboard>
<Storyboard >
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="Popup" Storyboard.TargetProperty="IsOpen" FillBehavior="HoldEnd">
<DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True" />
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="UIElement.LostFocus">
<BeginStoryboard>
<Storyboard >
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="Popup" Storyboard.TargetProperty="IsOpen" FillBehavior="HoldEnd">
<DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False" />
</BooleanAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
Now this helps open the popup on focus, but when I select any item from dropdown the pop up doesnt disappear as usual; it stays open. it closes only after I click somewhere else in the window. Can someone please suggest the proper way to do this
Thanks in advance
I have a model window that contains expander.
I want when expander is collapsed or expanded the window will resize its height accordingly at run time.
Pleas help!!
I have many (600) EPS files(300 KB - 1 MB) in database. In my ASP.NET application (using ASP.NET 4.0) I need to retrieve them one by one and call a web service which would convert the content to the JPEG file and update the database (JPEGContent column with the JPEG
content). However, retrieving the content for 600 of them itself takes too long from the SQL management studio itself (takes 5 minutes for 10 EPS contents).
So I have two issues:-
1) How to get the EPS content ( unfortunately, selecting certain number of content is not an option :-( ):-
Approach 1:-
foreach(var DataRow in DataTable.Rows)
{
// get the Id and byte[] of EPS
// Call the web method to convert EPS content to JPEG which would also update the database.
}
or
foreach(var DataRow in DataTable.Rows)
{
// get only the Id of EPS
// Hit database to get the content of EPS
// Call the web method to convert EPS content to JPEG which would also update the database.
}
or
Any other approach?
2) Converting EPS to JPEG using a web method for 600 contents.
Ofcourse, each call would be a long running operation. Would task parellel library (TPL) be a better way to achieve this?
Also, is doing the entire thing in a SQL CLR function a good idea?
Is it possible to read cookie expiration time with php ?
When I print_r($_COOKIE) it outputs:
Array
(
[PHPSESSID] => 0afef6bac83a7db8abd9f87b76838d7f
[userId] => 1232
[userEmail] => [email protected]
[firstName] => user
[lastName] => user
)
So I think $_COOKIE don't have the expiration time, is it possible with some other function?
hey guys,
please help me in finding the solution to some of these Amazon questions:
given a file containing approx 10 million words, design a data structure for finding the anagrams
Write a program to display the ten most frequent words in a file such that your program be efficient in all complexity measures.
you have a file with millions of lines of data. Only two lines are identical; the rest are all unique. Each line is so long that it may not even fit in the memory. What is the most efficient solution for finding the identical lines?