|
Before defining the report source you should add a viewercore.
Example
reportViewer.ViewerCore.ReportSource = CrystalReport1
|
|
|
|
|
Hi to all.
I am new to WPF. Now I m building a small project. That contain Timer and Label and Datagrid.
In Datagrid 7 columns are there. If i add a row in Button_Click Event it is working. But same code not working in Timer
In Timer I return below code.
On Error Resume Next
Row_Nos_Text.Dispatcher.Invoke(New delSetText(AddressOf doSetText), Row_Nos_Text, DataGrid1.Items.Count)
DataGrid1.Items.Add(0)
The Above code display Number of row in textbox but in datagrid row was not added
Plz tell how to solved Problem.
Thanks in advance.
Nanda
|
|
|
|
|
In my wcf service i have 10 methods i want to give my client to access 5 methods only.
|
|
|
|
|
Original available here[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi, I have developed an application using Silverlight3 and WCF where I am fetching some data from database and binding to a datagrid.For small resultsets the application is working fine.But for large resultsets it gives an error at EndGet Method.
I checked the buffersize,maxReceivedMessageSize,receiveTimeout,closeTimeout,
openTimeout,sendTimeout.All are set to suitable values.
Can anyone help on this issue?
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
Increase those values according to your requirement, then it'll work.
|
|
|
|
|
<pre>
&lt;binding name="BasicHttpBinding_IOMSService" closeTimeout="00:50:00"
openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:50:00"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"&gt;
&lt;security mode="None" /&gt;
&lt;/binding&gt;
</pre>
maxbufferSize,maxReceiveSize is set to the maximum integer value.
senTimeout,receiveTimeout are given.....do I really need to increase them??plz look at the values for them....
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
Whats the exception you are getting?Can you give some info about exception.
|
|
|
|
|
I am testing using Fiddler...for large results (a table with 114 columns and 3880 rows i need that to return), it says connection closed unexpectedly
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
CrazyCoder26 wrote: I checked the buffersize,maxReceivedMessageSize,receiveTimeout,closeTimeout,
openTimeout,sendTimeout
Increase sendTimeout to a bigger value and try again.
|
|
|
|
|
<pre>
<binding name="BasicHttpBinding_IOMSService" closeTimeout="00:50:00"
openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:50:00"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</pre>
maxbufferSize,maxReceiveSize is set to the maximum integer value.
senTimeout,receiveTimeout are given.....do I really need to increase them??plz look at the values for them....
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
Try by increasing the sendTimeout. See here.
|
|
|
|
|
Increased the sendTimout to 10:20:00....but still getting error
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
It seems Mr.Abhinav has given up my Issue!!!!
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
CrazyCoder26 wrote: It seems Mr.Abhinav has given up my Issue!!!!
Try enabling gzip compression on the service.
If that does not work, I give up!
And I hope you increased the maxbuffer size in your config file.
modified on Monday, April 26, 2010 7:26 AM
|
|
|
|
|
I checked the WCF with Fiddler...for large resultsets it also throws an exception saying "the connection closed unexpectedly".
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
Hi,
I need to style dataGrid rows for different background colors for alternate rows, different backgroundColor for hover and on selection I want to show a details template and on selection I also want a dotted blue border on the DataRow.
To achieve this, I create two different dataGrid styles, one for Datagrid where no row is selected and one for datagrid where a row is selected.
To apply styles I am handling SelectionChanged event of Datagrid. I am posting my code to get better idea.
<code>
<Window x:Class="Locations"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly=WpfToolKit"
xmlns:Primitives="clr-namespace:Microsoft.Windows.Controls.Primitives;assembly=WPFToolkit"
xmlns:Linq="clr-namespace:Linq"
Style="{StaticResource ExtWindow}" Icon="/Icons/building.png" >
<Window.Resources>
<Style x:Key="DatagridRowStyleRowDetails" TargetType="dg:DataGridRow">
<Setter Property="Background" Value="#DFE8F6" />
<Setter Property="BorderBrush" Value="{StaticResource CheckeredBlues}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="DetailsVisibility" Value="Visible" />
<Setter Property="DetailsTemplate">
<Setter.Value>
<DataTemplate DataType="{x:Type Linq:Address}">
<StackPanel>
<Label Content="Address:" />
<StackPanel Margin="0,0,0,10">
<WrapPanel Margin="0,0,0,-10" >
<Label Content="{Binding Path=HouseNumber}" />
<Label Content="{Binding Path=Street}" />
<Label Content="{Binding Path=IdentifierType}" />
<Label Content="{Binding Path=IdentifierValue}" />
</WrapPanel>
<WrapPanel Margin="0,0,0,-10">
<Label Content="{Binding Path=City}"/>
<Label Content="{Binding Path=State}" />
<Label Name="lblZip" Style="{StaticResource fieldLabelStyle}" Content="{Binding Path=Zip}" />
</WrapPanel>
</StackPanel>
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DatagridRowStyleLocal" TargetType="dg:DataGridRow">
<Setter Property="Background" Value="#FFFFFF" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Width" Value="{Binding RelativeSource=
{RelativeSource FindAncestor,
AncestorType={x:Type dg:DataGrid}},
Path=ActualWidth}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dg:DataGridRow}">
<Border Name="OuterBorder" SnapsToDevicePixels="True" BorderThickness="0, 1, 0, 0" BorderBrush="#FFFFFF" Background="{TemplateBinding Background}">
<Border Name="InnerBorder" SnapsToDevicePixels="True" BorderThickness="1, 0, 1, 1" BorderBrush="#EDEDED" Background="{TemplateBinding Background}">
<Primitives:DataGridCellsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" />
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="#FAFAFA" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="#EFEFEF" />
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="#DDDDDD" />
<Setter TargetName="OuterBorder" Property="BorderThickness" Value="1" />
<Setter TargetName="InnerBorder" Property="BorderThickness" Value="0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<DockPanel Width="500" >
<StackPanel>
<dg:DataGrid Style="{StaticResource DatagridStyle}" RowStyle="{StaticResource DatagridRowStyleLocal}" SelectionChanged="dataGridAddress_SelectionChanged" >
<dg:DataGrid.Columns>
<dg:DataGridTextColumn Binding="{Binding Path=Location.LocationSerialNumber}" Header="Location" />
<dg:DataGridTextColumn Binding="{Binding Path=HouseNumber}" Header="No." />
<dg:DataGridTextColumn Binding="{Binding Path=Street}" Header="Street" />
<dg:DataGridTextColumn Binding="{Binding Path =City}" Header="City" />
<dg:DataGridTextColumn Binding="{Binding Path=State}" Header="State" />
<dg:DataGridTextColumn Binding="{Binding Path=Location.TotalObjects}" Header="Objects" />
<dg:DataGridTextColumn Binding="{Binding Path=Location.TotalServices}" Header="Services" />
<dg:DataGridTextColumn Width="60" Header="Time" />
<dg:DataGridTemplateColumn Header="Completed" IsReadOnly="True" >
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button IsEnabled="{Binding Path=IsCompleted}" Style="{StaticResource imageButtonStyle}" />
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
</dg:DataGridTemplateColumn>
</dg:DataGrid.Columns>
</dg:DataGrid>
</StackPanel>
</DockPanel>
</Window>
</code>
in code behind Selechanged event:-
<code>
private void dataGridAddress_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
object selectedItem = e.AddedItems[0];
DataGridRow selectedRow = dataGridAddress.ItemContainerGenerator.ContainerFromItem(selectedItem) as DataGridRow;
selectedRow.Style = this.Resources["DatagridRowStyleRowDetails"] as Style;
foreach (var item in dataGridAddress.Items)
{
if (item != e.AddedItems[0])
{
var dataGridRow = dataGridAddress.ItemContainerGenerator.ContainerFromItem(item) as DataGridRow;
dataGridRow.Style = this.Resources["DatagridRowStyleLocal"] as Style;
}
}
}
</code>
Styles are working ok as per requirement but if rows are selected rapidly then application crashes and throws exception
"The specified Visual is not an ancestor of this Visual."
Any idea how to fix this. I googled and found out that it is a bug, any one knows any workaround.
Thanks for reading,
Veena
|
|
|
|
|
Hi Experts,
I have created a user control in windows application and used it in wpf.
The user control is in a seperate project and solution than that of wpf.
I have exposed some properties in the user control and tried to use it in a wpf form.
I have used it in the WindowsFormsHost element and also added WindowsFormsIntegration reference.
I am facing the following problems:
1. I am able to see the user control in the toolbox but it is disabled.
2. I am able to design the user control in xaml and give values to properties. I am also getting the properties in intellisense but the same is not getting reflected/applied during design as well as run time.
3. I am not able to see the control in the properties window even after selecting it. I am just able to see WindowsFormsHost in the property window.
I am not able to find any sample project or explanation of this in code project. If there is any then please do let me know.
Also I am able to use this user control in a windows application very easily and it is working fine. Am i missing anything for wpf?
I can give the source code if required but i dont think it will be of much help as i have not done anything fancy.
Please help!
Thanks in Advance!
Regards,
Samar
modified on Thursday, April 22, 2010 8:49 AM
|
|
|
|
|
Hi Experts,
Any ideas on the above mentioned??
Regards,
Samar
|
|
|
|
|
i need to extract search results link from a google page...plz help me..i grab the html content of the page but cannot grab the search links...
|
|
|
|
|
Use a regular expression to pull out the <a> tags. BTW - I'm curious. How is this related to this forum?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi, I am new to Silverlight.I have created a simple silverlight application which uses a WCF dataservice to fetch some data from database.The WCF service is inside the application itself.The application runs fine in my development environment.But when I host the application in IIS,whenever the application tries to communicate with the WCF dataservice, it throws some error saying,"Unhandled error in silverlight application,An Exception occured during the operation,making the result invalid.Check inner exception details at System.ComponentModel.AsyncCompletedEventArgs.RaiseExecptionIfNecessary at
SQLData.ServiceReference1.GetCustomerByTerrytoryEventArgs.get_Result() at
...................................
The System.ServiceModel configuration is web.config is given below :
<pre>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="SQLData.Web.Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="SQLData.Web.Service1Behavior" name="SQLData.Web.Service1">
<endpoint address="" binding="basicHttpBinding" contract="SQLData.Web.IService1">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
</pre>
I am totally confused....I searched the web...and applied everything they said....but still getting this error......Please help me solve this issue.
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
|
Thanks for posting the solution.
You could however format it using PRE tags to make it more readable.
|
|
|
|
|
I've several WPF Control-Library type projects in a solution. Build provides DLLs for each project.
How can I combine these user-controls into a single DLL? And, show a particular control based on XAML specification when used in a project? What should be approach to do this?
May be in XAML, to display controls, we just need to write something like this
<Window xmlns:CombinedControl="SomeThing">
<Grid x:Name="LayoutRoot">
<CombinedControl:Control1/>
<CombinedControl:Control2/>
<CombinedControl:Control3/>
<CombinedControl:Control4/>
</Grid>
|
|
|
|