Hi Ewan,
I cannot reproduce. Tried this to add null and DBValue.Null to a DateTime column in a DataTable.
var t = new DataTable();
t.Columns.Add("C1", typeof(DateTime));
t.Columns.Add("C2", typeof(Decimal));
t.Columns.Add("C3", typeof(Boolean));
t.Rows.Add(null, null, null);
t.Rows.Add(DBNull.Value, DBNull.Value, null);
t.Rows.Add(DateTime.Now, 5.5m, true);
Population works ok. Then on a click:
dt.Rows.Add(null, null, null); dt.Rows.Add(DBNull.Value, DBNull.Value, null);
Which also works fine. Tried the same in winforms too.
Do you have a CellStyle or column.DefaultCellStyle saved in InitializeComponent() or in code? The main fix related to the previous issue you reported was that the DataGridViewColumn defined the wrong DefaultCellStyle.DataSourceNullValue = DateTime.MinValue when it should have been DefaultCellStyle.DataSourceNullValue = DBNull.Value.
Can you send me directly a reproducible case or a code snippet? Use my email address. I’d like to address this issue.
Hi Arturo,
The problem you are facing is now fixed.
You can get the updated extension from https://github.com/iceteagroup/wisej-extensions .
Best regards,
Alaa
Hi Kevin,
For 1,2 and 3 Ideal is to use a class for structure Model like
public class MyData
{
public string Name { get; set; }
public string Lastname { get; set; }
public List<KeyValuePair<string, string>> Checks { get; set; } = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>(“name”,”Name”),
new KeyValuePair<string, string>(“lastname”,”Lastname”),
};
public KeyValuePair<string,string> CurrentCheck { get; set; }
public MyData(int i)
{
CurrentCheck = Checks.First();
if(i % 3 == 0)
{
Checks.Add(new KeyValuePair<string, string>(“middlename”, “Middlename”));
Checks.Add(new KeyValuePair<string, string>(“surname”, “Surname”));
} else if (i % 3 == 1)
{
Checks.Add(new KeyValuePair<string, string>(“surname”, “Surname”));
}
else
{
}
}
}
For 4:
DataReapeter have an attribute ItemTemplate : use a UserControl like ItemTemplate and Bind Like this
PS For that sample I use my own Application Logic but is same as you want to do
UserControl : ItemTemplateSupport
Code :
public string CurrentName {
get => textBox1.Text;
set { textBox1.Text = value; }
}
public string Lastname {
get => textBox2.Text;
set { textBox2.Text = value; }
}
public List<KeyValuePair<string,string>> ComboBoxValues
{
set { comboBox1.DataSource = value; }
get => (List<KeyValuePair<string, string>>)comboBox1.DataSource;
}
}
BaseView: DataRepeaterSupport
public partial class DataRepeaterSupport : Page
{
//List Bindable
BindingList<MyData> Data { get; set; }
public DataRepeaterSupport()
{
InitializeComponent();
//Initialization
Data = new BindingList<MyData>();
//Setting DataSource
dataRepeater1.DataSource = Data;
//ItemTemplate created
var itemTemplate = new ItemTemplateSupport();
itemTemplate.Dock = DockStyle.Fill;
//Add Binding on public Property created on ItemTemplateSupport class
itemTemplate.DataBindings.Add(new Binding(“CurrentName”, Data, “Name”));
itemTemplate.DataBindings.Add(new Binding(“Lastname”, Data, “Lastname”));
itemTemplate.DataBindings.Add(new Binding(“ComboBoxValues”, Data, “Checks”));
//Add item template to dataRepeater
dataRepeater1.ItemTemplate.Controls.Add(itemTemplate);
}
}
With UserControl you are free to add logic on your template
Best,
Kevin (ITG)
Hi Alessandro,
You can use the Tools property of the form to generate those extra buttons in the title bar.
You simply name the buttons and give them the appropriate icons.
You can also set the Tools property on other controls like a TextBox, MaskedTextBox,ComboBox, etc…
I have attached a sample that includes adding those buttons both “programmatically” and in designer.
Best regards,
Alaa
Hello
It will work because the Result from MongoDB is an object JSON.
Thanks
Code attempts:
{
dataRepeater1.DataSource = Data1; // Defined elsewhere and correct
tbText1.DataBindings.Add(“Text”, Data1, “Text1”);
tbText2.DataBindings.Add(“Text”, Data1, “Text2”);
cboCombo.DisplayMember = “value”;
cboCombo.ValueMember = “key”;
cboCombo.DataSource = GetSelection(dataRepeater1.CurrentItemIndex); // returns a valid key/value pair but only ever returns the first item
}
private List<KeyValuePair<string, string>> GetSelection(int ind) { // Note: Testing only, not actual data
List<KeyValuePair<string, string>> cboList = new List<KeyValuePair<string, string>>();
cboList.Add(new KeyValuePair<string, string>(“~”, “Select…”));
switch (ind) {
case 1:
cboList.Add(new KeyValuePair<string, string>(“ABC”, “This is ABC”));
cboList.Add(new KeyValuePair<string, string>(“RFD”, “This is RFD”));
break;
default:
cboList.Add(new KeyValuePair<string, string>(“NA”, “Not Applicable”));
break;
}
return cboList;
}
Hi Luiz,
If the object has properties (dynamic or not) that corresponds to the data you’re trying to bind, then yes.
If you can provide a small sample we can look at it further.
Examples of DataBinding:
https://github.com/iceteagroup/wisej-examples
You can also see the attached screenshots to see how DataBinding can work with an array of objects (I assume your MongoDB / DynamoDB would be similar).
HTH,
Levie
Hi Alessandro,
First response is for Server Side.
This response is more adapted.
With Theme Builder you can create your effect into a custom theme.
You must use hovered state , opacity transition and property “opacity”.
Your theme will be like this :
{
"appearances": {
"transparent-panel": {
"inherit": "panel",
"states": {
"default": {
"styles": {
"transition": "opacity 500ms"
},
"properties": {
"opacity": 0.5
}
},
"hovered": {
"properties": {
"opacity": 1
},
"styles": {
"transition": "opacity 1000ms"
}
}
}
}
}
}
Best,
Kevin(ITG)
The code you attached shows a form without a constructor and without a call to InitializeComponent(), the event is not attached, etc. You need to attach a runnable sample that shows the problem.
BTW, this is the automation option to help with automated UI tests in Default.json:
“options”: {“automation.mode”: true},
In this mode Wisej generates immutable dom ids using the full path to the root. This way automated tests can pinpoint a target even when the id sequence changes. For example, for the tree node you’d get this:
id=”Page1_treeView1_TreeNode_1″
It’s the name of the main page + name of TreeView control + name of the treenode. It follows the hierarchy. It also adds the “owner”, “opener” and “container” attributes to the DOM element for detached targets like a context menu, popup menus, embedded controls. I.e. if a button1 opens a contextmenu, the menu’s element will have opener=”button1″.
HTH
Hi Stepan,
Thanks for letting us know! We’re able to reproduce the issue, it’s logged as #2591.
I’ll keep you updated on the status of the issue.
Best,
Levie
Hey Levie.
Thank you so much! That worked perfectly.
Yep, I noticed the error but didn’t really know its meaning… 🙂
Lots to learn, my friend.
Cheers.
Ivan
Hi Ivan,
You can only return simple values (simple objects, primitives) back to the server. args.event tries to send complex dom objects and if you look in the browser console you’ll see the “Maximum Call Stack Exceeded” error.
If you want to get which keys are pressed, you can do something like this:
case "keyDown":
return {
key: args.event.key,
altKey: args.event.altKey,
keyCode: args.event.keyCode,
ctrlKey: args.event.ctrlKey,
metaKey: args.event.metaKey,
shiftKey: args.event.shiftKey
};
I’ll also go ahead and update the DX extension on GitHub with this as well!
HTH,
Levie
The rotation is a css style, it only rotates the browser’s rendering of the element. There is no “rotation” of coordinates or code logic. Sounds like you need a right-to-left trackbar? See attached screenshot. The TrackBar in Wisej has the RightToLeft property but it’s not fully implemented yet. I can send you a patch for that. Or you can use the trackbar from devex or syncfusion.
Having investigated this further.
The datetime column picks up the correct values for MinValue ie 01/01/1753 from the binding source
The editing control, however defaults to a MinValue of 01/01/0001.
The MinValue of 01/01/0001 is what gets passed back to the server when a new row is added and the date has not been edited
When you edit an existing row either Null or 01/01/0001 is passed back if the date has not been edited (presumably depending on the browser /browser settings)
Having read
| #2585 | DataGridViewDateTimePickerColumn.DefaultCellStyle incorrectly sets the DataSourceNullValue to DateTime.MinValue. Should be DBNull. |
I tried setting this in code, however when you start to populate a new row you get the attached error
dgv.Columns[3].DefaultCellStyle.DataSourceNullValue = DBNull.Value;
Thanks for your help
Hi Alessandro,
For Transparency you can use BackhroundColor and set opacity like this panel1.BackColor = Color.FromArgb(100, Color.Red);
First int is for opacity is go from 0 to 255, 0 is fully Transparent and 255 is completly filled
And for your effect you can use Event MouseOver and MouseLeave
Best,
Kevin(ITG)
ExpandableObjectConverter expands the object. That is a System.ComponentModel class that has always worked like that. It’s not a Wisej issue.
The code snippet works without issues. You need to send a small test case showing what it is that you trying to do with a task inside a task.
Hi Levie,
thank you, with DisplayFormat it work!
Please can you write an example also with Parser? I could be wrong myself
best
Cristian
The issue is ongoing in 2.2.39 as well. Please fix asap or add an option/attribute to behave like it was initailly
The full property looks like this:
[SRCategory(“xyz”)]
[SRDescription(“My Background Color”)]
[DisplayName(“Background Color”)]
[Editor(typeof(ColorPickerEditor), typeof(UITypeEditor))]
[TypeConverter(typeof(ColorTypeConverter))]
public Color BackColor { get; set; }
Whereas ColorTypeContrter looks like:
public class ColorTypeConverter : ExpandableObjectConverter
{
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if(destinationType == typeof(string))
{
return ((Color)value).Name == “0” ? “” : ((Color)value).Name;
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
