Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mocasu

@mocasu
About
Posts
16
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • GridSplitter Cursor
    M mocasu

    Hi, This is what I do

    <GridSplitter Grid.Column="0" ResizeDirection="Columns" Background="LightGray" Width="5" MouseEnter="GridSplitter_MouseEnter" MouseLeave="GridSplitter_MouseLeave"/>

    private void GridSplitter_MouseEnter(object sender, MouseEventArgs e)
    {
    if (this.Cursor != Cursors.Wait)
    Mouse.OverrideCursor = Cursors.SizeWE;
    }

        private void GridSplitter\_MouseLeave(object sender, MouseEventArgs e)
        {
            if (this.Cursor != Cursors.Wait)
                Mouse.OverrideCursor = Cursors.Arrow;
        }
    

    I first check if the mouse is already in Waiting mode, as I dont want the users to be able to resize the app while I am doing some other stuff. Hope it helps

    WPF csharp wpf help question

  • Problems setting Grid Height [modified]
    M mocasu

    Hi All, I have a grid defined as follows

    <Grid MaxHeight="768">
    <Grid.RowDefinitions>
    <RowDefinition Height="60"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="55"/>
    <RowDefinition Height="55"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="90"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="90"/>
    </Grid.ColumnDefinitions>
    </Grid>

    However when populating this grid, the last rows are not visible since there is a lot of data to display. I know that the Auto means take as much space as you need but, isnt the MaxHeight property define for the grid taking into account? (Grid's maxheight is window height) I would expect the auto rows to take as much space as it remains available Since this was not working I tried to set the auto rowdefinition as follows:

    <RowDefinition Height="Auto" MaxHeight="250"/>

    I am guessing that the height preference will be, starting for higher preference: MinHeight>MaxHeight>Heigth This does not work either. Eventhough I have set up the MaxHeight for that row, it will take as much space as it needs to display it contents, hence other rows are not visible. Any help will be greatly appreciated. Thanks

    modified on Thursday, September 3, 2009 6:55 PM

    WCF and WF css help question

  • c# and XML validation [modified]
    M mocasu

    Hi Greg, I think I should have been more precise. I knew I was passing the wrong data type to the .Add method. My problem was converting my string into a valid data type that the .Add will take. At the end I am doing as follows:

    StringReader sr = new StringReader(ClassLibrary1.Properties.Resources.jobs);
    XmlSchema schema = XmlSchema.Read(sr,null);
    sr.Close();
    //Add the schema to the collection
    xss.Add(schema);

    Anyway, thanks for your post!

    C# question xml csharp database help

  • c# and XML validation [modified]
    M mocasu

    Hi there, I have created an .xsd schema which I want to include in my project (Windows Service). First question is: what is the best way to include it? as a resource? or just by doing "Add existing item"? what is the difference(if any)? So far, I have added it as a resource (jobs.xsd). Ok, so now I want to validate an xml file, thus I am trying to do as follows:

    1. XmlSchemaSet xss = new XmlSchemaSet();
    2. //Add the schema to the collection
    3. xss.Add("http://www.w3.org/2001/XMLSchema",ClassLibrary1.Properties.Resources.jobs);
    4. XmlReaderSettings settings = new XmlReaderSettings();
    5. settings.ValidationType = ValidationType.Schema;
    6. settings.Schemas = xss;
    7. settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
    8. // Create the XmlReader object.
    9. XmlReader reader = XmlReader.Create(xmlPath, settings);
    10. // Parse the file.
    11. while (reader.Read()){};

    This code breaks on line 3, with a System.ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path) at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck) at System.IO.Path.GetFullPathInternal(String path) at System.IO.Path.GetFullPath(String path) at System.Xml.XmlResolver.ResolveUri(Uri baseUri, String relativeUri) at System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri) at System.Xml.Schema.XmlSchemaSet.Add(String targetNamespace, String schemaUri) at ClassLibrary1.ReadXml.ValidateXMLAgainstXSD(String xmlPath) in c:\myproj\ClassLibrary1\GetXml.cs:line 95} How could I get around this problem? Cheers

    modified on Tuesday, March 3, 2009 6:57 AM

    C# question xml csharp database help

  • unable to update a table on a access database [modified]
    M mocasu

    Thanks a lot! :) As you said, I had just switched the add parameter code and ...voilA!

    C# database question announcement

  • unable to update a table on a access database [modified]
    M mocasu

    Thanks...but either way the database is not being updated :(

    C# database question announcement

  • unable to update a table on a access database [modified]
    M mocasu

    hi all, Any ideas as to why the database is not being updated will be greatly appreciated! It is driving me mad...and I just can't see what i am doing wrong :confused: string dId = "Golden"; string dCharge = "150"; OleDbConnection connectDb = new OleDbConnection(db); connectDb.Open(); OleDbCommand update = new OleDbCommand("UPDATE ShippingCharges SET Charge = ? WHERE ShippingID = ?", connectDb); update.Parameters.Add("@ShippingID", OleDbType.Char).Value = dId; update.Parameters.Add("@Charge", OleDbType.Integer).Value = dCharge; update.ExecuteNonQuery(); connectDb.Close(); -- modified at 12:18 Saturday 1st December, 2007

    C# database question announcement

  • create a .csv file using a variable as the name
    M mocasu

    Cheers!

    C# help question

  • create a .csv file using a variable as the name
    M mocasu

    ...and what "good" did sarcasm brought to the whole afair!? ... I see your point Dave... " but when it came to giving a string representing a filename, you suddenly forgot how to do string concantenation! " It wasn't that I forgot,I just didn't know that it could be done like that...as you all might have gueesed by now I am new with this. Anyway, thanks to PIEBALconsul and David for the help

    C# help question

  • create a .csv file using a variable as the name
    M mocasu

    Thanks a lot David! really appreciate...that is what i was looking for. -- modified at 11:39 Saturday 13th October, 2007

    C# help question

  • create a .csv file using a variable as the name
    M mocasu

    Thanks for the info.;P I was checking for file existance in case the file had already been created, so the new file should have some extra character in the name to differenciate them.

    C# help question

  • create a .csv file using a variable as the name
    M mocasu

    ...if that's what you think you were being...Not everybody thinks the same...All of us can finish it with something different, it is just a matter of judgement

    C# help question

  • create a .csv file using a variable as the name
    M mocasu

    ...what can I say...thanks both of you for being so ...

    C# help question

  • create a .csv file using a variable as the name
    M mocasu

    ...In case it is not clear... int day = date.Day; int month= date.Month; int year= date.Year; string str="hi"; int res="123"; string fileName = day + month + year + "_" + str + "_" + res However, if I do : File.Create("c:\\code\\fileName.txt"), it creates a file with the name "fileName"...rather than the value of fileName ...any ideas?

    C# help question

  • create a .csv file using a variable as the name
    M mocasu

    ...I know how to concatenate strings! the problem is how I then refer to that "variable" when creating the .csv

    C# help question

  • create a .csv file using a variable as the name
    M mocasu

    Hi, I would like to know how I can create a .csv file with today's date and a variable name. I have the following: int day = date.Day; int month= date.Month; int year= date.Year; string str="hi"; int res="123"; Now I want to create a .csv file with the following name : 13102007_hi_123 I though of putting everything into a single string (lets' say, result) but then, how will the following code replace result with the string!? At present it creates a .csv file with the name of result if (!File.Exists("c:\\code\\result.txt")) { File.Create("c:\\code\\result.txt"); } Any help will be greatly appreciated...Cheers! ALSO, can I add a heather that will be ignored by excel?

    C# help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups