Forum Replies Created

Viewing 15 posts - 1,321 through 1,335 (of 1,351 total)
  • Author
    Posts
  • Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Mayank,

    I tested your code and got it to work by changing the last line. Both of thes options work :

    grid.Resources.Add(

    typeof( Xceed.Wpf.DataGrid.DataRow ), style );

    grid.Resources[

    typeof( Xceed.Wpf.DataGrid.DataRow ) ] = style;

    Imported from legacy forums. Posted by Diane [Xceed] (had 2343 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Matt,

    Upon verification, you shouldn’t have to set the TextTrimming property. By default, it should be already trimming using CharacterEllipsis. Have you by chance provided a CellContentTemplate that somehow disabled TextTrimming?

    Yes, with this code, the column will be expanded when you press the button. You may find this too drastic though. Displaying a popup window may be better suited.

    <xcdg:Column.CellContentTemplate>
      <DataTemplate>
          <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width=”Auto” />
            </Grid.ColumnDefinitions>
           
            <TextBlock Text=”{Binding}” />
            <Button Content=”…”
                    Click=”Button_Click”
                    Tag=”{Binding RelativeSource={RelativeSource AncestorType={x:Type xcdg:DataCell}}}”
                    Grid.Column=”1″/>
          </Grid>
      </DataTemplate>
    </xcdg:Column.CellContentTemplate>

    * You should put the button’s width in the Width property of the column.

     

    Imported from legacy forums. Posted by Diane [Xceed] (had 477 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Tomas,

    I received Daniel’s sample and found the problem. The dlls used in the sample are the 3.1.9069.14010, but when I change them to the latest ones (3.1.9117.10090) the empty cells display correctly as blank. Download and use the latest build and it will resolve your issue.

    Imported from legacy forums. Posted by Diane [Xceed] (had 2127 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Jim,

    You may have a CellEditor on your column, but you are missing a “cell viewer” to display the value when the cell isn’t being edited (and therefore the combobox isn’t visible).

    For example:

      <xcdg:Column FieldName=”CatName” Title=”Category Name”>

        <xcdg:Column.CellEditor>

          <!– rest of your code –>

        </xcdg:Column.CellEditor>

        <xcdg:Column.CellContentTemplate>

          <DataTemplate>

            <TextBlock Text=”{xcdg:CellEditorBinding}” />

          </DataTemplate>

        </xcdg:Column.CellContentTemplate>

      </xcdg:Column>

    This will solve the first issue you are describing, and may resolve the second as well but I haven’t done a thorough test to try and reproduce your situation. Let me know if you still have problems after adding the cell viewer.

     

    Imported from legacy forums. Posted by Diane [Xceed] (had 1899 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Tomas,

    I have received an email from Daniel explaining exactly this case.

    I tried to make a quick app using your layout to reproduce to problem, but in my case everything worked fine.The only other thing I noticed is that I had to change the binding for the Boss’s details, otherwise the column was empty even when I had values.

    <xcdg:Column FieldName=”Boss.Email”  Title=”Boss Email” />

    I used the latest build (3.1.9117.10090) for my tests. If you aren’t using the latest dlls, I recommend you download them and test again. If you are still having trouble, please have Daniel send me a sample application which reproduces this problem so I may continue my investigation with the support case he already opened.

    Imported from legacy forums. Posted by Diane [Xceed] (had 2112 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Only the DataCells of the DataRow being edited can have validation errors (unless we are talking about general errors using IDataErrorInfo). Only the current row can be in edition. So, you can check the ErrorContent of the current row’s DataCells by using GetContainerFromItem and sending it the CurrentItem.

    The following example should point you in the right direction :

      private void GetGridErrors()
      {
        string errorMessage = “No Error Found”;
        if( this.grid.HasValidationError )
        {
          int errorCount = 0;
          string errorText = “”;

          Xceed.Wpf.DataGrid.DataRow dataRow = ( Xceed.Wpf.DataGrid.DataRow )this.grid.GetContainerFromItem( this.grid.CurrentItem );

          foreach( DataCell dataCell in dataRow.Cells )
          {
            if( dataCell.HasValidationError )
            {
              errorCount++;
              errorText += “[” + dataCell.ValidationError.ErrorContent.ToString() + “]”;
            }
          }

          if (errorCount < 2)
            errorMessage = errorCount.ToString() + ” error found: ” + errorText;
          else
            errorMessage = errorCount.ToString() + ” errors found: ” + errorText;
        }

        this.txtError.Text = errorMessage;
      }

     

    Imported from legacy forums. Posted by Diane [Xceed] (had 1878 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Truong,

     Check out my answer regarding Unbound Columns : http://xceed.com/CS/forums/thread/18310.aspx

    Imported from legacy forums. Posted by Diane [Xceed] (had 2205 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Kevin,

    You can do this by using the TitleTemplate property of the Column :

      <xcdg:DataGridControl.Columns>
        <xcdg:Column FieldName=”FirstName” Title=”First Name” >
          <xcdg:Column.TitleTemplate>
            <DataTemplate>
              <TextBlock Text=”{xcdg:CellEditorBinding}” HorizontalAlignment=”Right” />
            </DataTemplate>
          </xcdg:Column.TitleTemplate>
        </xcdg:Column>
        …
      </xcdg:DataGridControl.Columns>

    Imported from legacy forums. Posted by Diane [Xceed] (had 2057 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Solaimalai,

    Check out the following thread: http://xceed.com/CS/forums/thread/18782.aspx
    In your case, simply change FixedHeaders by FixedFooters.

    Adding an InsertionRow to the FixedFooters (in XAML) :

      <xcdg:DataGridControl x:Name=”myGrid” ItemsSource=”{Binding Source={StaticResource mySource}} >
        <xcdg:DataGridControl.View>
          <xcdg:TableView>
            <xcdg:TableView.FixedFooters>
              <DataTemplate>
                <xcdg:InsertionRow />
              </DataTemplate>
            </xcdg:TableView.FixedFooters>
          </xcdg:TableView>
        </xcdg:DataGridControl.View>
      </xcdg:DataGridControl>

    And in code (C#) :

      DataTemplate template = new DataTemplate();
      template.VisualTree = new FrameworkElementFactory( typeof( InsertionRow ) );

      TableView view = new TableView();
      view.FixedFooters.Add( template ):
      myGrid.View = view;

    Imported from legacy forums. Posted by Diane [Xceed] (had 2033 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Henrique,

    This is normal as we do not do the custom formatting. However, by setting the NumberStyles to Currency we do allow the user to type in the currency symbol for example.

    http://doc.xceedsoft.com/products/XceedWpfDataGrid/Numeric_Editors.html
    In the table you will see that setting the NumberStyles to Currency indicates that all styles are used except for AllowExponent and AllowHexSpecifier. This is to indicate what values/formats are accepted as input, but we do not enforce a format.

    If you want to format the displayed number in a specific fashion (for example: making sure to add the currency symbol if the user didn’t do it), you will need to handle it yourself. A good place to do this should be in the QueryTextFromValue event. I recommend looking at the “Included Editors” sample application.

    Imported from legacy forums. Posted by Diane [Xceed] (had 2448 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Rene,

     You will need to add an InsertionRow to your grid. Check out Example 1 of the following help page :

    http://doc.xceedsoft.com/products/XceedWpfDataGrid/Table_View.html

    The example shows how to add it to the FixedHeaders, but you can add it to the FixedFooters if you prefer to have it at the bottom of the grid.

    * Headers / Footers : will scroll along with your rows and go in and out of visible range.

    * FixedHeaders / FixedFooters : will be fixed at the top/bottom of the grid and will not scroll

    Imported from legacy forums. Posted by Diane [Xceed] (had 332 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Sam,

    There is no ScrollViewer on the DataRow, that is why it doesn’t appear even when using that Style.
    What you will have to do is create a ControlTemplate to redo the DataRow template, this is where you will add a ScrollViewer. Then in your Style, you assign that ControlTemplate to the Template property of the DataRow.

    Imported from legacy forums. Posted by Diane [Xceed] (had 446 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Sam,

    Unfortunately we do not have anything readily available that would allow you to dynamically change the height of the DataRow. That is something you would have to implement yourself.

    Imported from legacy forums. Posted by Diane [Xceed] (had 387 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Sam,

    By default the text in the cards doesn’t wrap, which means that you need to manually set the TextWrapping property of those columns to “Wrap” or to “WrapWithOverflow” for longer text to wrap on multiple lines. If you do not specify the TextWrapping, or if you set it to “NoWrap”, your cards will all be the same height.

    <xcdg:DataGridControl.Columns>

    <xcdg:Column FieldName=”Comments” TextWrapping=”NoWrap” />

    </xcdg:DataGridControl.Columns>

    Imported from legacy forums. Posted by Diane [Xceed] (had 493 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Sam,

    You can obtain that result by setting the HideEmptyCells property to False. This will cause all the fields to be displayed and therefore all the cards will have the same height.

    <xcdg:DataGridControl x:Name=”myGrid” … >

    <xcdg:DataGridControl.View>

    <xcdg:CardView HideEmptyCells=”False” … />

    </xcdg:DataGridControl.View>

    </xcdg:DataGridControl>

    Imported from legacy forums. Posted by Diane [Xceed] (had 510 views)

Viewing 15 posts - 1,321 through 1,335 (of 1,351 total)