|
HI
My problem is to show in a column of my ListView of pictures after conversion ConvertImage (byteBLOBData); I also think that problem comes can be of my source code XAML.
If you can look at my code please
private void RemplirListeUtilisateur()
{
dt_ListeUtilisateur.Clear();
cmd.CommandText = "SELECT U.IDUTILISATEUR,U.MyImage, U.NOMUTILISATEUR,U.PRENOMUTILISATEUR,U.ADRESSE,U.CODEPOSTALE,U.TELEPHONE,P.NOMPAYS AS PAYS,D.NOMDEPARTEMENT AS DEPARTEMENT FROM UTILISATEUR U INNER JOIN PAYS P ON U.IDPAYS = P.IDPAYS INNER JOIN DEPARTEMENT D ON U.IDDPEPARTEMENT = D.IDDEPARTEMENT";
sqlDa = new SqlDataAdapter();
sqlDa.SelectCommand = cmd;
try
{
sqlDa.Fill(dt_ListeUtilisateur);
DataTable Temp = new DataTable();
Temp.Columns.Add("IDUTILISATEUR");
Temp.Columns.Add("NOMUTILISATEUR");
Temp.Columns.Add("PRENOMUTILISATEUR");
Temp.Columns.Add("ADRESSE");
Temp.Columns.Add("CODEPOSTALE");
Temp.Columns.Add("TELEPHONE");
Temp.Columns.Add("PAYS");
Temp.Columns.Add("DEPARTEMENT");
Temp.Columns.Add("MyIMAGE");
for (int Index = 0; Index < dt_ListeUtilisateur.Rows.Count; Index++)
{
DataRow MyDataRow = Temp.NewRow();
MyDataRow["IDUTILISATEUR"] = dt_ListeUtilisateur.Rows[Index] ["IDUTILISATEUR"].ToString();
MyDataRow["NOMUTILISATEUR"] = dt_ListeUtilisateur.Rows[Index]["NOMUTILISATEUR"].ToString();
MyDataRow["PRENOMUTILISATEUR"] = dt_ListeUtilisateur.Rows[Index]["PRENOMUTILISATEUR"].ToString();
MyDataRow["ADRESSE"] = dt_ListeUtilisateur.Rows[Index]["ADRESSE"].ToString();
MyDataRow["CODEPOSTALE"] = dt_ListeUtilisateur.Rows[Index]["CODEPOSTALE"].ToString();
MyDataRow["TELEPHONE"] = dt_ListeUtilisateur.Rows[Index]["TELEPHONE"].ToString();
MyDataRow["PAYS"] = dt_ListeUtilisateur.Rows[Index]["PAYS"].ToString();
MyDataRow["DEPARTEMENT"] = dt_ListeUtilisateur.Rows[Index]["DEPARTEMENT"].ToString();
int c = dt_ListeUtilisateur.Rows.Count;
if ((dt_ListeUtilisateur.Rows[Index]["MyImage"].ToString() != String.Empty) || (dt_ListeUtilisateur.Rows[Index]["MyImage"].ToString().Equals("null")))
{
Byte[] byteBLOBData = new Byte[0];
byteBLOBData = (Byte[])(dt_ListeUtilisateur.Rows[c - 1]["MyImage"]);
MemoryStream stmBLOBData = new MemoryStream(byteBLOBData);
ConvertImage(byteBLOBData);
MyDataRow["MyImage"] = images;
}
Temp.Rows.Add(MyDataRow);
}
lstUtilisateur.ItemsSource = Temp.DefaultView;
Code XAML :
<gridviewcolumn header="Image" displaymemberbinding="{Binding Path=MyImage}">
|
|
|
|
|
I achieved all other columns in ListView to show pictures in the column picture
Encode XAML for the column Picture
|
|
|
|
|
Hi,
I am building a silverlight control for uploading files. that has some user defined properties like file filter etc.
I want to assign values to those from the aspx page in which i am hosting that control.
Please tell me how to do that.
Thanks in advance..
|
|
|
|
|
You can use param tags or the InitParameters property in the page that hosts the silver light control.
Take a look at the code of the html or aspx page that gets created as part of your silver light project.
This link gives a few details on how to use InitParameters.
http://www.dotnetspider.com/Silverlight-Tutorial-313.aspx[^]
|
|
|
|
|
Thanks for the reply.
I want to know if i can use the ID of the control to directly access the properties.
example: if the the silverlight control Id is Xaml1 and one of the property is FolderName
can i use Xaml1.FolderName="value"?
Another thing i want to know how the control is getting called.
Please let me know if i can access the properties without using query string or InitParameters.
Thanks in advance.
|
|
|
|
|
|
Hi,
I have one problem: In code, I call a function which is provided by others and this function will pop out a dialog. The function return a object and it has long integer value. I think the value is a window handle. So how to convert this handle to a wpf window?
thanks,
eric
|
|
|
|
|
|
Hey guys
I need to append text to a WPF RichTextBox, but specific colors.
After much googling i put together the following method
private void AppendRtfText(string Text, Brush Color)
{
TextRange range = new TextRange(txtChat.Document.ContentEnd, txtChat.Document.ContentEnd);
range.Text = Text;
range.ApplyPropertyValue(TextElement.ForegroundProperty, Color);
}
Now this works just fine, but I need to be able to specify RGB values.
The TextElement.ForegroundProperty only accepts a Brush and as far as I can see I cant specify RGB for a brush like i would with the Color class.
Any ideas? Cause I'm running out
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
|
Worked like a charm, thanks
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Hi..
I am new to this concept.How to add a message or text in the ellipse of xmal element at run time of windows application.Is in a xmal ellipse control we can put text box to write text? if yes how, if not please suggest me the other way if possible...
the code :
Ellipse x:Name="C2" Height="353" Width="440" Stroke="LightPink" StrokeThickness="05" Visibility="Hidden" Fill="blue" Canvas.Top="63" Canvas.Left="80">
modified on Tuesday, May 5, 2009 12:54 AM
|
|
|
|
|
You're looking at the problem from the wrong end: An ellipse does not have the opportunity to display text, but a Label can take whatever look you want through a control template
<Grid>
<Grid.Resources>
<Style x:Key="EllipseLabel" TargetType="{x:Type Label}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<Grid >
<Ellipse Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Stroke="LightPink"
StrokeThickness="05"
Fill="blue" />
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Label Width="200" Height="100" Style="{StaticResource EllipseLabel}" Content="hello world" />
</Grid>
...accordingly, if you change your label's content, the text changes.
NetDrives - Open Source Network Share Management
|
|
|
|
|
Sir,
Thanks for your concern. i need the text like textbox while in rumn time wt we want we are inserting,like this way i want to write some thing in the ellipse at run mode of the windows appliaction.
Thanks and Regards
Ch.Gaytari
|
|
|
|
|
There's no problem doing that - you can change a label's content at runtime through a binding expression or code. It's a label, after all. even though it looks like an ellipse.
NetDrives - Open Source Network Share Management
|
|
|
|
|
Could you please give the sample code of this problem.Thanks in advance.
With Regards
Ch.Gayatri
|
|
|
|
|
This is regular WPF 101 - just give the label in my sample a name like this:
<Label x:Name="myLabel" ... />
...and in code, set the text:
myLabel.Content = "this is easy";
NetDrives - Open Source Network Share Management
|
|
|
|
|
let the windows form having text box ok..whn its in run mode we are able to enter some value in it like this way i need to write some thing like text or message in the ellipse of the xmal elements.Or any other way to solve this solution .Please suggest me.
Thanks
Ch.Gayatri
|
|
|
|
|
If you want to enter text, you need to style another control, e.g. textbox:
<Grid>
<Grid.Resources>
<Style x:Key="EllipseLabel" TargetType="{x:Type TextBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid >
<Ellipse Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Stroke="LightPink"
StrokeThickness="05"
Fill="blue" />
<ScrollViewer HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0" x:Name="PART_ContentHost"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<TextBox Width="200" Height="100" Style="{StaticResource EllipseLabel}" Text="hello world" />
</Grid>
NetDrives - Open Source Network Share Management
|
|
|
|
|
<Window x:Class="SreenDeginer.Window1"<br />
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
Title="Window1" Height="530" Width="852"><br />
<Canvas Height="498" Width="787"><br />
<Button Canvas.Left="40" Canvas.Top="10" Background="LightPink" Height="47" Width="73" Click="Button_Click" /><br />
<br />
<Canvas Height="422" Width="628" x:Name="c2" Background="Black" Visibility="Collapsed" Canvas.Left=" 20" Canvas.Bottom="5" Canvas.Top="67"><br />
<Rectangle Height="422" Width="56" Fill="Beige"></Rectangle><br />
<Rectangle Height="33" Width="628" Fill="Pink" Canvas.Left="0" Canvas.Top="0"><br />
<br />
</Rectangle><br />
<TextBlock Text="X" Canvas.Left="607" Foreground="Black" x:Name="ClBtn" MouseLeftButtonDown="TextBlock_MouseLeftButtonDown" Height="23" Width="21"></TextBlock><br />
<Ellipse x:Name="E1" Height="25" Width="39" Stroke="Black" Canvas.Left="09" Canvas.Bottom="324" Canvas.Top="40" Fill="LightPink" MouseLeftButtonDown="E1_MouseLeftButtonDown"><br />
</Ellipse><br />
<Ellipse x:Name="E2" Height="322" Width="523" Stroke="LightPink" StrokeThickness="05" Visibility="Hidden" Fill="Blue" Canvas.Top="63" Canvas.Left="80" MouseMove="M1_MouseMove" MouseLeftButtonDown="M2_MouseLeftButtonDown" MouseLeftButtonUp="M3_MouseLeftButtonDown" ></Ellipse><br />
<Rectangle Name="MyRectangle" Stroke="Black" Width="39" Fill="LightPink" Canvas.Left="09" Canvas.Bottom="316" Height="17" MouseLeftButtonDown="R1_MouseLeftButtonDown"/><br />
<Rectangle Name="REC2" Height="258" Width="507" Visibility="Hidden" Stroke="LightPink" StrokeThickness="05" Fill="Blue" Canvas.Top="66" Canvas.Left="85" MouseMove="M1_MouseMove" MouseLeftButtonDown="M2_MouseLeftButtonDown" MouseLeftButtonUp="M3_MouseLeftButtonDown" ></Rectangle><br />
<br />
<!--<Polygon x:Name="P1" Height="27" Width="39" Canvas.Left="09" Canvas.Bottom="600" Canvas.Top="125" Fill="LightPink" ></Polygon>--><br />
<br />
<Ellipse x:Name="C1" Height="25" Width="28" Stroke="Black" Canvas.Left="09" Canvas.Bottom="600" Canvas.Top="125" Fill="LightPink" MouseLeftButtonDown="C1_MouseLeftButtonDown" ></Ellipse><br />
<Ellipse x:Name="C2" Height="353" Width="440" Stroke="LightPink" StrokeThickness="05" Visibility="Hidden" Fill="blue" Canvas.Top="63" Canvas.Left="80" MouseMove="M1_MouseMove" MouseLeftButtonDown="M2_MouseLeftButtonDown" MouseLeftButtonUp="M3_MouseLeftButtonDown" ></Ellipse><br />
<Rectangle Name="Square" Height="27" Width="39" Stroke="black" Canvas.Left=" 09" Canvas.Top="170" Fill="LightPink" MouseLeftButtonDown="SQ1_MouseLeftButtonDown"></Rectangle><br />
<Rectangle Name="SQ1" Height="290" Width="290" Stroke="LightPink" StrokeThickness="05" Visibility="Hidden" Fill="Blue" Canvas.Top="63" Canvas.Left="85" MouseMove="M1_MouseMove" MouseLeftButtonDown="M2_MouseLeftButtonDown" MouseLeftButtonUp="M3_MouseLeftButtonDown" ></Rectangle><br />
<Polygon Name="T1" Points="70,70 40,1 1,70" Stroke="black" Fill="LightPink" Height="38" Width="57.9" Canvas.Top="215" Canvas.Right="580" MouseLeftButtonDown="T1_MouseLeftButtonDown" /><br />
<Polygon Name="T2" Points="500,252 252,03 25,250" Stroke="LightPink" StrokeThickness="05" Fill="Blue" Visibility="Hidden" Height="300" Width="530" Canvas.Top="63" Canvas.Left="85" MouseMove="M1_MouseMove" MouseLeftButtonDown="M2_MouseLeftButtonDown" MouseLeftButtonUp="M3_MouseLeftButtonDown" /><br />
<Polygon Name="S1" Visibility="Hidden" Stroke="Blue" StrokeThickness="1.0" Points="176.5,50 189.2,155.003 286.485,113.5 201.9,177 286.485,240.5 189.2,198.997 176.5,304 163.8,198.997 66.5148,240.5 151.1,177 66.5148,113.5 163.8,155.003" Canvas.Top="63" Canvas.Left="85" Fill="Blue" Height="332" Width="375" MouseMove="M1_MouseMove" MouseLeftButtonDown="M2_MouseLeftButtonDown" MouseLeftButtonUp="M3_MouseLeftButtonDown" /><br />
<Polygon<br />
Name ="mypolygon1"<br />
Stroke="LightPink" <br />
StrokeThickness="03" <br />
Points="176.5,70 189.2,155.003 286.485,113.5 201.9,177 286.485,240.5<br />
189.2,198.997 176.5,304 163.8,198.997 66.5148,240.5 151.1,177<br />
66.5148,113.5 163.8,155.003" Height="343" Width="356" Fill="Blue" Canvas.Top="63" Canvas.Left="85" Visibility="Hidden" MouseMove="M1_MouseMove" MouseLeftButtonDown="M2_MouseLeftButtonDown" MouseLeftButtonUp="M3_MouseLeftButtonDown" /><br />
<br />
<br />
<br />
</Canvas><br />
<br />
</Canvas><br />
</Window><br />
|
|
|
|
|
inside canvas also i can apply the given code in all these xmal elemts like ellipse,rectangular,square a.d so on..
|
|
|
|
|
|
<pre></pre><Ellipse x:Name="C2" Height="353" Width="440" Stroke="LightPink" StrokeThickness="05" Visibility="Hidden" Fill="blue" Canvas.Top="63" Canvas.Left="80" MouseMove="M1_MouseMove" MouseLeftButtonDown="M2_MouseLeftButtonDown" MouseLeftButtonUp="M3_MouseLeftButtonDown" ></Ellipse>
<TextBox Name="TB5" Visibility="visible" Background="Transparent" Height="121" Width="218" Canvas.Top="179" Canvas.Left="223"></TextBox>
ike this way also at run time we can write text,,is any mutiline set to true is any property is ther for texbox in WPF
Thanks and Regards
CH.Gayatri
|
|
|
|
|
sir can i apply that code under canvas..
|
|
|
|
|
I give up, can't find any good information about this anywhere
I have a UserControl with 6 textboxes. I have a quite complex datastructure from where I want to fill these textboxes. The datastructure contains several sets of "String[6]" but I can't figure out how to bind it
public partial class MyAttBox : UserControl
{
public static DependencyProperty LowChRXProperty = DependencyProperty.Register("LowChRX", typeof(String), typeof(MyAttBox));
public String LowChRX
{
get { return (String)GetValue(LowChRXProperty); }
set { SetValue(LowChRXProperty, value); }
}
}
"main" XAML:
<AttBox:MyAttBox Header="GSM 850" x:Name="AttBox_GSM850" />
my data is stored like:
public class ABC
{
private Dictionary<String, List<String>> m_values = new Dictionary<String, List<String>>();
public Dictionary<String, List<String>> Values
{
get { return m_values; }
set { m_values = value; }
}
What I want to is to select a Key in my code and connect the Values to the texboxes in my UC. How?
|
|
|
|