How to change WPF table width and height
-
Hi, I am using WPF table in my application to display my data.But the table was fixed to particular width. I am not able to change this. I want this table's width as my WPF form width. I tried in <FlowDocument.Resources>, Style tag. But not able to change the width and height. Below is my code. <FlowDocumentReader Margin="67,150,51,267" > <FlowDocument> <FlowDocument.Resources> <Style TargetType="{x:Type Paragraph}"> <!--<Setter Property="" Value="100%"/>--> <Setter Property="FontSize" Value="12px"/> </Style> </FlowDocument.Resources> <Table CellSpacing="3" > <Table.Columns> <TableColumn /> <TableColumn /> <TableColumn/> </Table.Columns> <TableRowGroup> <!-- Header row for the table. --> <TableRow Background="Orange"> <TableCell> <Paragraph FontSize="12pt" FontWeight="Bold">Code</Paragraph> </TableCell> <TableCell > <Paragraph FontSize="12pt" FontWeight="Bold" >Description</Paragraph> </TableCell> <TableCell> <Paragraph FontSize="12pt" FontWeight="Bold">Amount</Paragraph> </TableCell> </TableRow> <!-- Three data rows for the inner planets. --> <TableRow> <TableCell> <Paragraph> 001 </Paragraph> </TableCell> <TableCell> <Paragraph> Tax Preparation Fee paid to LOS Taxes </Paragraph> </TableCell
-
Hi, I am using WPF table in my application to display my data.But the table was fixed to particular width. I am not able to change this. I want this table's width as my WPF form width. I tried in <FlowDocument.Resources>, Style tag. But not able to change the width and height. Below is my code. <FlowDocumentReader Margin="67,150,51,267" > <FlowDocument> <FlowDocument.Resources> <Style TargetType="{x:Type Paragraph}"> <!--<Setter Property="" Value="100%"/>--> <Setter Property="FontSize" Value="12px"/> </Style> </FlowDocument.Resources> <Table CellSpacing="3" > <Table.Columns> <TableColumn /> <TableColumn /> <TableColumn/> </Table.Columns> <TableRowGroup> <!-- Header row for the table. --> <TableRow Background="Orange"> <TableCell> <Paragraph FontSize="12pt" FontWeight="Bold">Code</Paragraph> </TableCell> <TableCell > <Paragraph FontSize="12pt" FontWeight="Bold" >Description</Paragraph> </TableCell> <TableCell> <Paragraph FontSize="12pt" FontWeight="Bold">Amount</Paragraph> </TableCell> </TableRow> <!-- Three data rows for the inner planets. --> <TableRow> <TableCell> <Paragraph> 001 </Paragraph> </TableCell> <TableCell> <Paragraph> Tax Preparation Fee paid to LOS Taxes </Paragraph> </TableCell
FYI, I (and many others) do not even look at code if it is poorly formatted (no tabs) and isn't syntax highlighted. Here is an example of well formatted and syntax highlighted code:
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" MaxWidth="100">Overwrite</Button>
<Button Grid.Column="1" MaxWidth="100">Skip</Button>
<Button Grid.Column="2" MaxWidth="100">Cancel</Button>
</Grid>And here's what was typed to get the above to look the way it does:
<pre lang="xml"><Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" MaxWidth="100">Overwrite</Button>
<Button Grid.Column="1" MaxWidth="100">Skip</Button>
<Button Grid.Column="2" MaxWidth="100">Cancel</Button>
</Grid></pre>Basically, you just surround your code with PRE tags and make sure to specify the correct language (in my example, the language was XML) by setting the "lang" attribute to the appropriate value. I got all the ampersands, less than signs, and greater than signs to encode properly by clicking "Encode HTML tags when pasting", which is a checkbox just below the textbox you type messages into. By the way, my above code sample has nothing to do with your question... it's just a demonstration of what is expected from people who ask questions. FYI, you can edit your original post to improve it if you want; you'll be much more likely to get a response that way.
Visual Studio is an excellent GUIIDE.
-
FYI, I (and many others) do not even look at code if it is poorly formatted (no tabs) and isn't syntax highlighted. Here is an example of well formatted and syntax highlighted code:
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" MaxWidth="100">Overwrite</Button>
<Button Grid.Column="1" MaxWidth="100">Skip</Button>
<Button Grid.Column="2" MaxWidth="100">Cancel</Button>
</Grid>And here's what was typed to get the above to look the way it does:
<pre lang="xml"><Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" MaxWidth="100">Overwrite</Button>
<Button Grid.Column="1" MaxWidth="100">Skip</Button>
<Button Grid.Column="2" MaxWidth="100">Cancel</Button>
</Grid></pre>Basically, you just surround your code with PRE tags and make sure to specify the correct language (in my example, the language was XML) by setting the "lang" attribute to the appropriate value. I got all the ampersands, less than signs, and greater than signs to encode properly by clicking "Encode HTML tags when pasting", which is a checkbox just below the textbox you type messages into. By the way, my above code sample has nothing to do with your question... it's just a demonstration of what is expected from people who ask questions. FYI, you can edit your original post to improve it if you want; you'll be much more likely to get a response that way.
Visual Studio is an excellent GUIIDE.
-
That was my intention. The first PRE block shows what syntax highlighting is and the second shows how to syntax highlight (by using PRE blocks).
Visual Studio is an excellent GUIIDE.
-
That was my intention. The first PRE block shows what syntax highlighting is and the second shows how to syntax highlight (by using PRE blocks).
Visual Studio is an excellent GUIIDE.