This is a migrated thread and some comments may be shown as answers.

Repaint DataEntry after form resize

8 Answers 156 Views
DataEntry
This is a migrated thread and some comments may be shown as answers.
Alex Dybenko
Top achievements
Rank 2
Alex Dybenko asked on 11 Mar 2019, 09:30 AM

Hi,

I have DataEntry with Dock=Fill, is it possible to "repaint" or "redraw" DataEntry after changing form's size, so controls width corresponds form width?

 

Thanks

Alex

 

 

8 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 12 Mar 2019, 07:47 AM
Hello Alex,

This is possible by using RadDataLayout control where you just need to dock the entire control to the form: RadDataLayout. This control has similar API and you will be able to easily replace the RadDataEntry.

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Alex Dybenko
Top achievements
Rank 2
answered on 12 Mar 2019, 11:34 AM

Hi Dimitar,

RadDataLayout works ok, but one thing: the last field (or last row) is vertically aligned in the center of bottom space, see attached, how to set equal space between items? I don't see ItemSpace property... 

 

Thanks,

Alex

 

0
Dimitar
Telerik team
answered on 12 Mar 2019, 02:56 PM
Hi Alex,

The last item is filling the entire remaining space and the content is vertically centered. You can set its alignment to top like this:
var lastItem = radDataLayout1.LayoutControl.Items.Where(x => x.AccessibleName == "City").First() as  DataLayoutControlItem;
lastItem.ControlVerticalAlignment = RadVerticalAlignment.Top;
lastItem.TextAlignment = ContentAlignment.TopLeft;

I hope this helps. Should you have any other questions do not hesitate to ask.
 
Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Alex Dybenko
Top achievements
Rank 2
answered on 13 Mar 2019, 08:17 AM

Hi Dimitar,

thanks, works fine! One more question - if I have 9 fields and 2 columns - item #5 is 2 times wider than others, how to change item width? I have tried lastItem.Width, lastItem.Size, lastItem.DefaultSize - no luck

 

Alex

 

0
Alex Dybenko
Top achievements
Rank 2
answered on 13 Mar 2019, 08:26 AM
Just thought - perhaps I should add one more empty item, instead of changing width?
0
Dimitar
Telerik team
answered on 13 Mar 2019, 09:37 AM
Hi Alex,

This is the only approach I can think of as well. In RadLayutControl the entire space must be filled by its child controls and the last child will fill the remaining space. 

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Alex Dybenko
Top achievements
Rank 2
answered on 13 Mar 2019, 11:16 AM

Ok, in case somebody need it - here a code to add empty item:

'Get last item on column 1
Dim lastItem As DataLayoutControlItem = RadDataLayout1.LayoutControl.Items(CInt(Math.Ceiling(RadDataLayout1.LayoutControl.Items.Count / 2)) - 1)
 
Dim li As New LayoutControlLabelItem
RadDataLayout1.LayoutControl.AddItem(li, lastItem, LayoutControlDropPosition.Right)

0
Dimitar
Telerik team
answered on 13 Mar 2019, 02:00 PM
Hi Alex,

Thank you for sharing your solution. Do not hesitate to contact us if you have other questions.
 
Regards,
Dimitar
Progress Telerik
Get quickly and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DataEntry
Asked by
Alex Dybenko
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Alex Dybenko
Top achievements
Rank 2
Share this question
or