Force the row height in the Xceed DataGridControl - xceed-datagrid

Can anybody tell me how to set the row height in the Xceed DataGridControl ? Because setting the styling for DataRow, Row, and DataCell does nothing. It seems that it's fixed at 30, and I've been unable to find any way to change it, even searching the examples that come with the grid.

There are two ways...
In the Resource:
<Style TargetType="{x:Type xcdg:DataRow}">
<Setter Property="Height" Value="40" />
</Style>
In the DataGridControl.View:
<xcdg:DataGridControl.View>
<xcdg:TableflowView ContainerHeight="40" />
</xcdg:DataGridControl.View>
Here in the Xceed-Forum: http://xceed.com/CS/forums/post/32514.aspx

Related

.NET MAUI TableView collapses when Entry control receives focus

I have a TableView in which I render form controls for data editing.
However, as soon as the Entry control receives focus, the ViewCell seemingly collapses, leaving only the section title and separator borders visible:
<TableView Intent="Data">
<TableRoot>
<TableSection Title="Details">
<ViewCell>
<Grid ColumnDefinitions="0.5*,0.5*">
<Label Text="Manufacturer" />
<Entry Text="{Binding Manufacturer}" Grid.Column="1" />
</Grid>
</ViewCell>
</TableSection>
</TableRoot>
</TableView>
Initial state:
After tapping the Entry element:
I've tried setting a specific height for the Grid and the Entry control, but I get the same result regardless.
Am I missing something obvious here? 🤔
It's a bug in .NET MAUI: https://github.com/dotnet/maui/issues/10322
I ran into this a while ago and reported it. For now, I have created my own table using a Grid.
You can change The TableView HeightRequest property to a large number such as 700.
This is a temporary workaround until the bug is fixed.
<TableView HeightRequest="700">
<TableRoot>
<TableSection>
<!-- Your code goes here -->
</TableSection>
</TableRoot>
</TableView>
But, in most scenarios, you don't know what the Height is so you could set it dynamically in your code behind.
Page constructor:
public MainPage()
{
InitializeComponent();
// if you want your table height to fit half of the page
Table.HeightRequest = this.Height / 2;
// Rest of logic...
}
Xaml:
<TableView x:Name="Table">
<TableRoot>
<TableSection>
<ViewCell>
<Label Text="Example"/>
</ViewCell>
</TableSection>
</TableRoot>
</TableView>

In MUI v5, how to make all element the same height and align vertically?

I am learning material-ui v5 and it's new styling system, using sx, how do I set a bunch of different element on the same line to have the same height?
<Mui.Box m={2}
component="form"
sx={12}
md={12}
noValidate
autoComplete="off"
>
<Mui.Card variant="outlined" raised sx={{ p: 2 }}>
<Mui.Grid container
spacing={2}
direction="row"
alignItems="center"
justifyContent="center">
<Mui.Grid item xs={12} md={3}>
<Mui.TextField
required
fullWidth
id="password"
label="Password"
type="password"
defaultValue=""
helperText="Some important text"
/>
</Mui.Grid>
<Mui.Grid item xs={12} md={3}>
<Mui.Button
fullWidth
variant="contained"
size="large">
Authenticate
</Mui.Button>
</Mui.Grid>
</Mui.Grid>
</Mui.Card>
</Mui.Box>
Here is what it currently look like:
As you can see they have different height and are not aligned vertically, how do I fix this?
Hover the grid items and you'll notice that the alignItems="center" is possibly starting you at a bad spot.
Change this to top then you know the elements are starting at the same spot. Seeing as you have the helperText, I think the best option is to then set your button height to match the TextField.
So, change the grid container prop alignItems="center" to alignItems="top" and then add something like sx={{ height: "56px" }} to your button.
If you need to do this frequently, make the button a styled component so you don't need to keep adding the sx prop.
See it here: https://codesandbox.io/s/usage-forked-tn7rw?file=/index.js
By the way, line 3 looks like it should be xs, not sx.
You can't control the height of the text box and the button precisely enough in MUI to make them exactly the same height, the "large" button is just slightly larger than a "small" text field.
But you can at least align them better by using alignItems="stretch" in the outer <Mui.Grid>:
But, in general it's much better to organize forms vertically, in a single column:
Single column forms convert a lot be!er than multi-column ones because you only have a single path to follow with your eyes, instead of jumping between blocks.

Xamarin forms; How to access the label from xaml.cs class of a rg.plugins pop up page?

I have a label in my rg.plugins popup page and I want to change the text color of the label when doing an action.
I try to add an id to the label in xaml, but that is not possible. Is there any way to change the label text color from xaml.cs class.
Thanks in advance
Some sample code would help understand what the issues might be. I assume by rg.plugins, you're referring to: https://github.com/rotorgames/Rg.Plugins.Popup so I will answer accordingly.
It looks like it takes standard xaml and displays that in a dialog type popup. Your options for styling should be the same as any other:
Change color directly in xaml. <Label Text="This is some text" TextColor="Blue" />
Change it via a binding. TextColor="{Binding ColorThatIWant}" Where the page's BindingContext has been set to an object that has a public property or binding property of ColorThatIWant. Don't forget to implement INotiftyPropertyChanged if you want forms to react to property changes.
Set the value in code behind. MyLabel.TextColor = UIColor.Blue; where the label has a name value set. <Label x:Name="MyLabel" Text="This is some text" />
Use style dictionaries to set the value. <Label Text="This is some text" Style="{StaticBinding MyLabelStyle}"/> with a style of:
<Style x:Key="MyLabelStyle" TargetType="Label">
<Setter Property="TextColor" Value="Blue" />
</Style>

GWTBootstrap3 equivalent of android's "match-parent"

Is there any way to fix the size of a Panel to take up the full space inside its Column instead of wrapping around the content?
My parent column has 2 panels side by side- one for stacked Navpils menu (with variable number of items) and one to show the data based on menu choice. I need the data panel to match the height of the menu panel.
Here's the relevant section of code:
<b:Column size="MD_3">
<b:Panel>
<b:PanelHeader>
<b:Heading size="H3" text="Services" />
</b:PanelHeader>
<b:PanelBody>
<b:NavPills stacked="true">
<b:AnchorListItem text="ClockService" ui:field="clockService" />
<b:AnchorListItem text="CloudService" ui:field="cloudService" />
<b:AnchorListItem text="CommandService" ui:field="commandService" />
<b:AnchorListItem text="WebConsole" ui:field="webConsole" />
<b:AnchorListItem text="DataService" ui:field="dataService" />
<b:AnchorListItem text="MqttDataTransport" ui:field="mqttDataTransport" />
<b:AnchorListItem text="SslManagerService" ui:field="sslManagerService" />
<b:AnchorListItem text="WatchdogService" ui:field="watchdogService" />
</b:NavPills>
</b:PanelBody>
</b:Panel>
</b:Column>
<b:Column size="MD_9">
<b:Panel ui:field="contentPanel">
<b:PanelHeader ui:field="contentPanelHeader">
</b:PanelHeader>
<b:PanelBody ui:field="contentPanelBody">
</b:PanelBody>
</b:Panel>
</b:Column>
Any help or suggestions are appreciated, I'm also open to using other widgets as long as they provide a similar view.
If you want the contents of a *Panel to use up all the available space, just wrap its contents in a Column with the appropriate size (like MD_12). Depending on your layout, it might be sufficient to reverse the hierarchy - the Panel should be the parent and the Column its child. If you have a lot of situations like this (or this is a widget that's used a lot), you can avoid "unnecessary" wrapping by just applying the CSS style .col-md-12 to your widget (the Panel's contents) directly.

field help text on form

Each share task form has fields. Some of them use icon to provide help text. For example, bpm:workflowPriority, get it. I need to remove this one.
I found, that сode below generates icons, but i cant understand, where the field.help process is runned. How i can hide icons for fields?
<#macro renderFieldHelp field>
<#if field.help?? && field.help?length > 0>
<span class="help-icon">
<img id="${fieldHtmlId}-help-icon" src="${url.context}/res/components/form/images/help.png" title="${msg("form.field.help")}" tabindex="0"/>
</span>
<div class="help-text" id="${fieldHtmlId}-help"><#if field.helpEncodeHtml>${field.help?html}<#else>${stringUtils.stripUnsafeHTML(field.help)}</#if></div>
</#if>
</#macro>
Help icon shows-up by-default when you have a constrain on your field. For example priority is defined as
<!-- Priority for the workflow as a whole -->
<property name="bpm:workflowPriority">
<type>d:int</type>
<default>2</default>
<constraints>
<constraint ref="bpm:allowedPriority" />
</constraints>
</property>
<constraint name="bpm:allowedPriority" type="LIST">
<parameter name="allowedValues">
<list>
<value>1</value>
<value>2</value>
<value>3</value>
</list>
</parameter>
</constraint>
I think help icon is a good idea if you have some constrain on your filed and want your user to select correct values.
You have following options:
If you don't need constraints , remove it from your model. You can override bpm:xxxxxx constraints by extending base model
You can look at BPMEngine code and change the template which generate help icon
Help icon is generated with class "help-icon" like :
span class="help-icon"
SO you can override form.css and hide this span. Something like this will work:
.form-container .help-icon {
visibility: hidden;
}
But this will remove all help icons from all the share forms, unless you change form divs and add some intelligence in your css selector.
Hope this helps.