How to avoid that the last column in a datagrid increase the width out of the window?

I have a datagrid with this configuraction:
<DataGrid.Columns>
<DataGridTextColumn Header="Column01" Binding="{Binding Property1, Mode=OneWay}"/>
<DataGridTextColumn Header="Column02" Binding="{Binding Property2, Mode=OneWay}"/>
<DataGridTextColumn Header="Column03" Binding="{Binding Property3, Mode=OneWay}"/>
</DataGrid.Columns>
The last column is a description, so the text can be a bit large. so I would like that the width don't be wnough greater than makes the datagrid has a width out side the window.
For this, I have read that I can use Width="Auto" in all the columns and in the last column width="*", but in this case all the coloumns has a very low width so I can't read anything.
The code that I have used in this case is:
<DataGrid.Columns>
<DataGridTextColumn Header="Column01" Binding="{Binding Property1, Mode=OneWay}" Width=""Auto"/>
<DataGridTextColumn Header="Column02" Binding="{Binding Property2, Mode=OneWay}" Width=""Auto"/>
<DataGridTextColumn Header="Column03" Binding="{Binding Property3, Mode=OneWay}" Width=""*"/>
</DataGrid.Columns>
I am using visual studio community edition and wpf 4.5.1.
Thank so much,

>>For this, I have read that I can use Width="Auto" in all the columns and in the last column width="*", but in this case all the coloumns has a very low width so I can't read anything.
Can't you just set an explicit width for the first two columns then?, e.g.:
<DataGrid.Columns>
<DataGridTextColumn Header="Column01" Binding="{Binding Property1, Mode=OneWay}" Width="100"/>
<DataGridTextColumn Header="Column02" Binding="{Binding Property2, Mode=OneWay}" Width="100"/>
<DataGridTextColumn Header="Column03" Binding="{Binding Property3, Mode=OneWay}" Width=""*"/>
</DataGrid.Columns>
There is also a MinWidth property that you can use to prevent the columns from being to narrow:
<DataGrid.Columns>
<DataGridTextColumn Header="Column01" Binding="{Binding Property1, Mode=OneWay}" Width="Auto" MinWidth="100"/>
<DataGridTextColumn Header="Column02" Binding="{Binding Property2, Mode=OneWay}" Width="Auto" MinWidth="100"/>
<DataGridTextColumn Header="Column03" Binding="{Binding Property3, Mode=OneWay}" Width=""*"/>
</DataGrid.Columns>
Hope that helps.
Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question.

Similar Messages

  • HT3228 Please let me know how to avoid receiving the spam into my email accounts on the iPad.  It is very annoying! My server puts it in the spam folder...why do I get it on the iPad?    Is it avoidable and how?

    Please let me know how to avoid receiving the spam (from the spam folder on the server) into my email accounts on the iPad.  It is very annoying!
    My server puts it in a spam folder and I do not receive it in the Ms Outlook on my desk computer...why do I get it on the iPad?    Is it avoidable and how?b

    You actually cannot do anything to your ipad when its locked but look at pictures the time and date, you need to restore it, and if it dosent let you restore, good luck chuck Heres how to restore it: Okay, i only know the itunes way soz, lol. Try to connect your ipad to itunes, if it does let you then you should be able to select the device you have in the corner somewhere, once you do that you should see a screen that looks sort of like your ipads setting, you should have a button that says "Restore" click that and your ipad should be restored. If that dosent work you should try going to your regular office depot or something. Good Luck!

  • I'm receiving some personnal SMS (through iOS 5 imessage) on an old iphone I've already sold. How to avoid that?

    Hi,
    I used to have an iPhone 3GS, which I recently upgraded to iOS 5 and sold. This device doesn't have any of my personnal information inside anymore (several resets and reinstall iOS5 from an blank iTunes on a seperate computer) and doesn't have my chip inside anymore.
    I am using a new smartphone (not Apple) now and when I text friends who have iPhone (with iOS 5 and iMessage), I receive some of the personnal responses on the old iPhone. It seems those messages are sent through iMessage...
    How to avoid that? I sold this iPhone and I don't want the buyer to receive my personnal message + I don't want to miss them on my new phone!
    Thanks for the help.
    Franck.

    I would suggest you read the user guide.  There IS no Facetime App for the iPhone.
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    < Edited By Host >

  • When I am opening photoshop elements 10 I see my desktop picture into photoshop elements 10 ans I don't know how to avoid that

    when I am opening photoshop elements 10 I see my desktop picture into photoshop elements 1- and I don't know how to avoid that. Does anybody know I can get rid of that picture, so that I only see the workspace of Elements?
    Thanks a lot

    What I said--go to the Window menu and turn on the application frame.

  • How do I set a fixed page size in Muse so that the window always stays the same size

    how do I set a fixed page size in Muse so that the window always stays the same size

    Hi Aish & thanks for responding;
    I would like the window size to stay the same for the entire site and not be
    able to scale to drag & scale it. ie 950 pixels x 500 pixels.
    Thanks,
    JB
    On 12/4/14 3:30 PM, "Aishvarya Raj Rastogi" <[email protected]>

  • How to determine that the user/ pernr is comp cord?

    Hi,
    In tcode pa30 i see there is Comp Cord field. so these are the HR persons right which use the three digits numbers.
    So my question is how to determine that the user/ pernr is comp cord?
    I want to create the fm and pass user id as import and want to find out where this user is belongs to comp coordinator or not.
    i do see some entry in the T526 table but not sure, how it work.
    Regards
    Ali

    hi ali,
    SACHX is the field you are looking for ..
    regards
    Manthan Raja

  • Help with Adobe.premiere.elements12. Please It would appear under the organizer tab that the photos are organised in the lowest folder in the folder structure within Windows Explorer.  How can I use the Windows Explorer structure to organise the photos wi

    Help with Adobe.premiere.elements12. Please
    It would appear under the organizer tab that the photos are organised in the lowest folder in the folder structure within Windows Explorer.  How can I use the Windows Explorer structure to organise the photos within Elements.

    In a situation such as yours, I tend to consolidate items into folders so I have folders of nice workable numbers of images, somewhere between 20 and 200 images. Now, whatever, once you've imported, do your moving within LR, not the OS! I will select all in a folder and drag into a folder a level or two or three above, and then delete the newly empty subfolders. I hope this helps a bit!
    Once you've reached just new Imports of camera output, you'll be flying along.

  • How do know that the battery is fully charged on ios 7

    How do know that the battery is fully charged on ios 7

    When you turn it on from sleep mode, below the time on the lock screen it says how much charged it is.

  • How to avoid, that a CPD-Customer will used in Sales ORDER?

    Hi,
    i will avoid, that the user inserts an CPD-Customer in sales orders.
    It's only in quotation allowed.
    Therefore i use include MV45AFZB with following code.
    FORM USEREXIT_CHECK_VBAK USING US_DIALOG.
    DATA: WA_KTOKD TYPE KTOKD.
    IF VBAK-VBTYP <> 'B'.
      SELECT SINGLE KTOKD FROM KNA1 INTO WA_KTOKD
             WHERE KUNNR = VBAK-KUNNR.
      IF WA_KTOKD = 'CPD'.
        MESSAGE E010(ZZ) WITH
                'CPD-cutomer is not allowed!'.
        MOVE 'ENT1' to FCODE.
        EXIT.
      ENDIF.
    ENDIF.
    My problem is, that the user cannot chage the customer numer when error appears.
    Is there another way to realize what i need, or is there a way to make the customer-Number
    changeable in this case?
    Hope anyone can help-
    Regards, Dieter

    Dieter
    Have you tried using order block?
    Firstly define an order blocking reason for CPDs and assign it to all relevant order types in config.
    SPRO/IMG/Sales and Distribution/Sales/Sales Documents/Define And Assign Reason For Blocking
    And then block all CPD customers using VD05 ( there will not be many, so it shouldn't take time).
    Alternately
    make it a warning in the code you wrote and copy the same code as an error while saving the order using
    MV45AFZZ - USEREXIT_SAVE_DOCUMENT_PREPARE or USEREXIT_SAVE_DOCUMENT
    Hope this helps.

  • On my Mac desktop I must have changed a setting so that now when I move the mouse the open windows fly off to the sides and I can't see them. They come back when I move the mouse, but it is so annoying. How can I make the windows not disappear like that?

    On my Mac desktop I must have changed a setting so that now when I move the mouse the open windows fly off to the sides and I can't see them. They come back when I move the mouse, but it is so annoying. How can I make the windows not disappear like that?

    Click on the Hot Corners..  button and look at the four definitions.  In the picture below, if you moved the cursor to the right top of the screen, it would slide all the applications off the screen as you describe and show the desktop.  Set it to "-" to deactivate.

  • How indesign detects that the images have been modified

    Hello,
    My problem is that all my images links are seen modified (yellow triangle) while the images don't have been modified.
    The modified dates are the same.
    All my images are on a unix server and indesign is used on Mac.
    How indesign detects that the images have been modified ?

    Thank you for your answer.
    When you say the time stamp you talk about the modification date in the box link info ?
    Because this date is the same on the image and in indesign and when I update the image this date doesn't change.
    the only informations that change when I update the links are the import date and the state (modified become ok)

  • How do I download the windows support software for my Mac? I am getting an error  message saying that the software is not available

    How do I download the windows support software for my Mac? I am getting an error  message saying that the software is not available

    Welcome to Apple Support Communities
    I do not recommend you to download the Windows support software through Boot Camp Assistant.
    Instead, you can download the Windows support software for most Macs from the Apple website. Go to this website, look for your MacBook Pro model and the Windows version you want to install, and follow its steps.
    To install Windows > http://manuals.info.apple.com/MANUALS/1000/MA1636/en_US/boot_camp_install-setup_ 10.8.pdf

  • How can I save the window size so that when I restart Firefox the size of the window is appropriate for my portrait mode monitor?

    I have a 2 monitor setup with my second monitor in portrait mode. Whenever I start Firefox (on my 2nd screen where I always open it) I always have to resize the window so it goes down to show more info. I cannot figure out how to reset any type of default window size for the height and width parameters.

    Hi,
    From your post, I assume you are creating WebHelp output.
    You  need to create a window for the help in the Project Set-up pod. Then,  you need to make sure you call the output so that the window is used.  See http://www.grainge.org/pages/authoring/calling_webhelp/calling_webhelp.htm.  This article on Peter's site give you an overview over the  possibilities of calling context sensitivive webhelp and also tells you  how to specify the needed window. Also, the installation directory of  RoboHelp 8 contains a directory called CSH API. In there are example  API's your developer can use to call the help.
    Greet,
    Willam

  • How to verify that the variable "does not contain" a value?

    Hi
    I am using CP 7.0.1.237.
    We want to use Text Area widget for a custom quiz and verify an answer. While we figured out how to verify the existence of certain keywords, we are not able to figure out how to verify that the content should NOT contain certain keywords. For example, we want to ensure that the text entered in this widget should not contain "Transformation" and "Non-compliant".
    Is this possible at all?
    Thanks
    Sreekanth

    Here's what the solution might look like in JavaScript.  This would be for SWF output and aimed at Cp 7.  For Cp 8, this would still work for SWF output, but you'd probably want to take advantage of the new unified JS API that gets and sets Cp variables for both SWF and HTML5 output.  You can read more about that here:  Common JS interface
    //Get the text area value from Captivate (SWF output Only)
    var cpTextAreaValue = document.Captivate.cpEIGetValue('m_VarHandle.v_TextArea);
    //convert the value to lower case to properly compare
    cpTextAreaValue = cpTextAreaValue.toLowerCase();
    //Check if text area value contains the words "transformation" or "non-compliant"
    if(cpTextAreaValue.indexof('organizational') > -1 && cpTextAreaValue.indexof('behavioral ') > -1 && cpTextAreaValue.indexof('managerial') > -1 && cpTextAreaValue.indexof('transformation') < 0 && cpTextAreaValue.indexof('non-compliant') < 0){
      //the text area has the correct answer so increment varScore
      //get the current score from Captivate
      var score = document.Captivate.cpEIGetValue('m_VarHandle.varScore');
      //increment score by 1
      score++;
      //set score in Captivate
      document.Captivate.cpEISetValue('m_VarHandle.varScore', score);
    } else {
      //the text area does not have the correct answer so show message to user inside of Captivate
      document.Captivate.cpEISetValue('m_VarHandle.v_message', 'Answer is not correct');
    This JS has not been tested.  Note that the "does not contain" operator is done using the "indexof" operator in JS. 
    Jim Leichliter

  • Locking middle or last column in a datagrid

    Does anyone know how to lock say the middle or last column in
    a datagrid. What i really need is for the first and fifth column to
    be locked in a datagrid or Advanced datagrid. Is this possible or
    do i need to put two datagrids next to each other and try to sync
    the vertical scroll??
    Thanks,
    -Jay

    >>For this, I have read that I can use Width="Auto" in all the columns and in the last column width="*", but in this case all the coloumns has a very low width so I can't read anything.
    Can't you just set an explicit width for the first two columns then?, e.g.:
    <DataGrid.Columns>
    <DataGridTextColumn Header="Column01" Binding="{Binding Property1, Mode=OneWay}" Width="100"/>
    <DataGridTextColumn Header="Column02" Binding="{Binding Property2, Mode=OneWay}" Width="100"/>
    <DataGridTextColumn Header="Column03" Binding="{Binding Property3, Mode=OneWay}" Width=""*"/>
    </DataGrid.Columns>
    There is also a MinWidth property that you can use to prevent the columns from being to narrow:
    <DataGrid.Columns>
    <DataGridTextColumn Header="Column01" Binding="{Binding Property1, Mode=OneWay}" Width="Auto" MinWidth="100"/>
    <DataGridTextColumn Header="Column02" Binding="{Binding Property2, Mode=OneWay}" Width="Auto" MinWidth="100"/>
    <DataGridTextColumn Header="Column03" Binding="{Binding Property3, Mode=OneWay}" Width=""*"/>
    </DataGrid.Columns>
    Hope that helps.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question.

Maybe you are looking for

  • Microsoft Word 2008 Spacing

    I know this probably isnt the "right" place for this question but Microsoft support forums are terrible so maybe someone here can help me. I have Microsoft Office 2008 and I the spacing between lines is too large, so I go to paragraph formatting and

  • Cisco ISE continuous Alarsm on every 2 minutes

    Hi, We have cisco Identity Service Engine (ISE) with Active/Standby deployment with the version 1.1.0.665 on both. We can see the number of alarms geneated so far in >60000 and every 2 minutes time we get one alarm on the dashboard saying "Alarm caus

  • Simple ALV interactive list...

    <b><b>hi i am a fresh Learner in ABAP and i am doing a small program in simple ALV interactive report in SD module that  gives me:: 1. SALES and then the invoice details of one particular value i click ,when delivery document number is given. 2. Deiv

  • How to make a window fixed in size

    Hi, Is there a method with which I can prevent the user from resizing the current window/Form Secondly, which event is generated when a window is resized? Thankx in advance...

  • Why are these words not acceptable?

    Following up from another question regarding the frustrating password validation, you answered back that these following words were not acceptable in one's password: 1234 4321 qwert test skype myspace password abc123 123abc abcdef iloveyou letmein eb