I have a bound grid that contains an image. Since the image is about the size of a thumbnail...I want to give the user the ability to click the image and have it displayed in full. I figured a good way to do this would be to use a RadLightBox. Am I barking down the right path? Is there a better way?
<telerik:RadGrid ID="rgMain" runat="server" Width="100%" AutoGenerateColumns="False">
<MasterTableView EditMode="PopUp" ShowHeadersWhenNoRecords="True" EnableNoRecordsTemplate="True" DataKeyNames="RaceID" CommandItemDisplay="Top">
<CommandItemSettings ShowRefreshButton="False" ShowAddNewRecordButton="False" />
<Columns>
<telerik:GridBoundColumn UniqueName="RaceName" DataField="RaceName" HeaderText="Race Name"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="SeriesName" DataField="SeriesName" HeaderText="Series"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="RaceDesc" DataField="RaceDesc" HeaderText="Description"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="RaceDate" DataField="RaceDate" HeaderText="Date" DataFormatString="{0:MM/dd/yyyy}"></telerik:GridBoundColumn>
<telerik:GridHyperLinkColumn DataNavigateUrlFields="RaceRegLink" HeaderText="Registration Link" DataTextField="RaceRegLink" Target="_blank"></telerik:GridHyperLinkColumn>
</Columns>
<DetailTables>
<telerik:GridTableView Name="Members" DataKeyNames="MemberID,RaceID" ClientDataKeyNames="MemberID,RaceID" Width="100%" ShowFooter="True">
<ParentTableRelation>
<telerik:GridRelationFields MasterKeyField="RaceID" DetailKeyField="RaceID" />
</ParentTableRelation>
<NoRecordsTemplate>No records to display.</NoRecordsTemplate>
<Columns>
<telerik:GridTemplateColumn HeaderText="Member" UniqueName="Member">
<ItemTemplate>
<telerik:RadBinaryImage ID="imgProfPic" runat="server" ImageUrl="~/images/ProfilePicBlank.jpg" Height="50px" Width="50px"
ResizeMode="Fit" DataValue='<%# IIf(Eval("ProfPic") IsNot DBNull.Value, Eval("ProfPic"), New System.Byte(-1) {})%>'
AlternateText='<%# Eval("MemberID") %>' />
<asp:Label runat="server" Text='<%# Eval("FullName") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="Division" DataField="Division" HeaderText="Division"></telerik:GridBoundColumn>
</Columns>
<HeaderStyle Font-Bold="True" BackColor="Silver" />
</telerik:GridTableView>
</DetailTables>
<NoRecordsTemplate>
No records to display.
</NoRecordsTemplate>
<HeaderStyle Font-Bold="True" BackColor="#CCCCCC" />
</MasterTableView>
</telerik:RadGrid>
I'm new in java script code i can't understand in the following code what is 'demo' is it the page or
browser or what
demo.lightBox = $find("<%=RadLightBox1.ClientID %>");
When scaling browser viewport the LightBox image aspect ratio is not preserved.
What can we do to make this work?
Thanks for yr time.
Marc
How to set the item width and height in accordance to the browser width and height in both code behind and client side?
Thanks.
is there a way to show the lightbox from code behind.
e.g. RadLightBox1.Show()
Hi guys!
Sorry, dumb question:
How can I show a lightbox automatically when the page loads?
I have a login form that I would like to pop up after the page "login.aspx" is loaded ... all I get is an empty page ....
"<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server">"
How can I achieve that?
Thanks in advance for your help
Tom
Hi,
Would it be possible to page in the LightBox without refreshing the whole page in this demo:
https://demos.telerik.com/aspnet-ajax/lightbox/examples/templates/defaultvb.aspx?show-source=true
Every time I click Next, the page is refreshed...
Marc
Hi,
I had purchased licensing a few years ago, and the radlightbox doesnt seem to be on there and says that it is an unknown server tag. Has there been an update with the bin folder files or do i have to buy new licensing?
All of the other telerik things work, but when searching the telerik UI for the lightbox its not in there
Thanks,
I have two RadListBox. Data in first box is populated from database using RadListBoxItem and I have set an attribute for each item. In the second box, I've created custom context menu. After I adding the item from first box to second box, user can select some option using the context menu. On context menu selection, I need to get the Attribute I set before and update the attribute value according to the context menu selection so I can used it for later process.Currently, I unable to even the attributes I set previously using the context menu's javascript. Please guide how to read ListItem's attribute and update the attribute to a new value.
This is how I add the item to the first box with attribute.
this._sortingList = new List<
Sorting
>();
this._sortingList = DBConnection.getSortingList();
foreach (var s in this._sortingList)
{
RadListBoxItem item = new RadListBoxItem();
item.Text = s.Description;
item.Value = s.Id.ToString();
item.Attributes["myorder"] = "0";
this.RadListBox1.Items.Add(item);
}
Thus custom context menu javascript.
function showContextMenu(sender, e) {
var menu = $find("<%= cm1.ClientID %>");
var rawEvent = e.get_domEvent().rawEvent; menu.show(rawEvent);
e.get_item().select();
$telerik.cancelRawEvent(rawEvent);
}
function onItemClicked(sender, e) {
var listBox = $find("<%= RadListBox1.ClientID %>");
var listItem = listBox.get_selectedItem();
var menuItem = e.get_item();
if (menuItem.get_text() == "Ascending"){
alert(listItem.get_attributes().getAttribute("myorder"));
}
else if (menuItem.get_text() == "Descending") {
alert(listItem.get_attributes().getAttribute("myorder"));
}
}
I'm trying to fetch the ClientID for a RadGrid control from client side using JavaScript so that I'll be able to bind data to this from the client side.
The RadGrid is present within the RadLightBox and needs to be populated on a button click event. The markup for LightBox looks something like this.
<telerik:RadLightBox ID="RadLightBox1" runat="server">
<Items><telerik:RadLightBoxItemrunat="server"><ItemTemplate><telerik:RadGrid runat="server" ID="lightbox_radgrid"AutoGenerateColumns="false"><MasterTableView><Columns><%-- Columns not shown here --%> </Columns></MasterTableView><ClientSettings><ClientEvents OnCommand="window_radgrid_OnCommand"/></ClientSettings><GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" /></telerik:RadGrid></ItemTemplate></telerik:RadLightBoxItem></Items></telerik:RadLightBox>
This is the partial Javascript Code that I have written. I am able to find upto the RadLIghtBoxItem element but unable to fetch the RadGrid and it's clientID. This method is to be executed on success of a call to a web service to return the data.
function
onSucessCallThis(result, userContext, methodName)
{
var radWindow = $find('<%= lightbox.ClientID %>');var LightBoxItems = radWindow.get_items(); console.log(LightBoxItems); console.log(LightBoxItems.get_count());var item = LightBoxItems.getItem(0); console.log(item); //Able to fetch LightBoxItemvar radGrid = item.FindControl("lightbox_radgrid"); //Doesn't work
}
I'm not sure if this is the right way to have a radGrid inside a radLightBox. There isn't many examples of this online.
If the code is unreadable here please check this stackoverflow question
http://stackoverflow.com/questions/38481200/finding-the-client-id-for-a-radgrid-inside-a-radlightboxitem-tag-in-a-radlightbo