Product Bundles
DevCraft
All Telerik .NET and Kendo UI JavaScript components and AI Tools in one package.
Kendo UI
Bundle of AI Tools plus four JavaScript UI libraries built natively for jQuery, Angular, React and Vue.
Build JavaScript UI
Javascript
Agent and App Development Solutions
Build. Accelerate. Govern.
AI-Ready Application Experiences
AI-Assisted SDLC
Agent Governance and Control
Telerik
Build modern .NET business apps
.Net Web
Desktop
Reporting and Documents
Cross-Platform
Additional Tools
Enhance the developer and designer experience
Testing & Mocking
CMS
Debugging
UI Tools
Free Tools
Support and Learning
Productivity and Design Tools
How to set the item width and height in accordance to the browser width and height in both code behind and client side?
Thanks.
Hi Alfred,
One option on the server-side is to use the DataBound event exposed by the RadListBox to set the desired item sizes:
protected void RadLightBox1_DataBound(object sender, EventArgs e) { foreach (RadLightBoxItem item in RadLightBox1.Items) { item.Height = 150; item.Width = 150; } }
<ClientEvents OnShowing="showing" />
JavaScript
function showing(sender, args) { var currentItemIndex = sender.get_currentItemIndex() var currentItem = sender.get_items().getItem(currentItemIndex) currentItem.set_width(150) currentItem.set_height(150) }
function showing(sender, args) { var currentItemIndex = sender.get_currentItemIndex() var currentItem = sender.get_items().getItem(currentItemIndex); currentItem.set_width(window.visualViewport.width - 100); currentItem.set_height(window.visualViewport.height - 100); }
Please let me know if any further questions come up.
Kind regards, Doncho Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.