Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
129 views

Hi all!!!

I have a grid with several columns. When I try to export to csv, all the columns are exported correctly, except for the one that is defined as GripDropdwonColumn. Do you know where the problem can be?

I attach the code regarding grid definition and C# code for grid events:

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="Center">
</telerik:RadAjaxLoadingPanel>   
             
    <telerik:RadGrid ID="RadGrid1" runat="server"
    AllowMultiRowSelection="True" 
    ShowStatusBar="True"
    AllowFilteringByColumn="True" AllowSorting="True" EnableHeaderContextMenu="true"
    AllowPaging="True"
    GridLines="None" Width="99.8%"
    AutoGenerateColumns="False"
    CellPadding="0" CellSpacing="0" PagerStyle-AlwaysVisible="true"
    HeaderStyle-ForeColor="Black" HeaderStyle-Font-Bold="true"                
    OnUpdateCommand="RadGridUrl_UpdateCommand"
    OnItemDataBound="RadGrid1_ItemDataBound"
    OnItemCreated="RadGrid1_ItemCreated"
    OnItemCommand="RadGrid1_ItemCommand"
    >
        <GroupingSettings CaseSensitive="false"  />
        <MasterTableView
        TableLayout="Fixed" ClientDataKeyNames="VeM_InvoiceId" Font-Size="11px"
        CommandItemDisplay="Bottom" InsertItemPageIndexAction="ShowItemOnCurrentPage"
        >
           
        <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" ShowExportToExcelButton="true" ShowExportToCsvButton="true" ></CommandItemSettings>
        <Columns>
                         
            <telerik:GridEditCommandColumn  HeaderStyle-Width="20px" ButtonType="ImageButton" UniqueName="GridButtonColumnEdit" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"/>
 
            <telerik:GridBoundColumn  HeaderText="Invoice" DataField="VeM_InvoiceId" UniqueName="VeM_InvoiceId"
            FilterControlWidth="45%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" ReadOnly="True"
            HeaderStyle-Width="60px" Visible="false"
            />  
                       
            <telerik:GridBoundColumn  HeaderText="Invoice Number" DataField="InvoiceNumber" UniqueName="InvoiceNumber"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center"
            HeaderStyle-Width="130px"
            />                  
 
            <telerik:GridBoundColumn  HeaderText="Invoicing VeOffice" DataField="TerritoryName" UniqueName="TerritoryName"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" ReadOnly="True"
            />                       
                          
            <telerik:GridBoundColumn  HeaderText="License" DataField="LicenseName" UniqueName="LicenseName"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" ReadOnly="True"
            />
                          
            <telerik:GridBoundColumn  HeaderText="Customer" DataField="CustomerName" UniqueName="CustomerName"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" ReadOnly="True"
            />
                          
            <telerik:GridBoundColumn  HeaderText="Country" DataField="Country" UniqueName="Country"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" ReadOnly="True"
            />
             
            <telerik:GridDropDownColumn UniqueName="InvoiceStatus" ListTextField="Name" ListValueField="VeM_InvoiceStatusId"
            DataField="VeM_InvoiceStatusId" HeaderText="Status" DropDownControlType="RadComboBox" 
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center"
            HeaderStyle-Width="75px" />
 
            <telerik:GridBoundColumn DataField="VeM_InvoiceStatusName" HeaderText="InvoiceStatusName" SortExpression="VeM_InvoiceStatusName"
            UniqueName="VeM_InvoiceStatusName" Display="false"/>
                          
            <telerik:GridBoundColumn  HeaderText="Invoiced Date" DataField="DateCreated" UniqueName="DateCreated"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" ReadOnly="True"
            />
 
            <telerik:GridDateTimeColumn HeaderText="Payment Date" DataField="DatePaid" UniqueName="DatePaid"
            FilterControlWidth="100%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center"
            PickerType="DatePicker"
            />
             
            <telerik:GridBoundColumn  HeaderText="" DataField="Symbol" UniqueName="Symbol"
            AllowFiltering="false"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" ReadOnly="True"
            HeaderStyle-Width="20px"
            />
                         
            <telerik:GridBoundColumn  HeaderText="Invoice Total" DataField="InvoiceTotal" UniqueName="InvoiceTotal"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center"
            DataFormatString="{0:#,0.00}"
            />
                          
            <telerik:GridBoundColumn  HeaderText="Number Sales" DataField="NumberSales" UniqueName="NumberSales"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center"
            />
                          
            <telerik:GridBoundColumn  HeaderText="Total Sales" DataField="TotalSales" UniqueName="TotalSales"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center"
            DataFormatString="{0:#,0.00}"
            />
                         
            <telerik:GridBoundColumn  HeaderText="Number Cancellations" DataField="NumberCancelations" UniqueName="NumberCancelations"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center"
            />
                          
            <telerik:GridBoundColumn  HeaderText="Total Cancellations" DataField="TotalCancelations" UniqueName="TotalCancelations"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center"
            DataFormatString="{0:#,0.00}"
            />
                          
            <telerik:GridBoundColumn  HeaderText="Updated Date" DataField="DateUpdated" UniqueName="DateUpdated"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" ReadOnly="True"
            />
                          
            <telerik:GridBoundColumn  HeaderText="Comments" DataField="Comments" UniqueName="Comments"
            FilterControlWidth="60%" AutoPostBackOnFilter="true" ShowFilterIcon="true"  CurrentFilterFunction="Contains"
            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" Visible="false"
            />   
                          
        </Columns>
             
        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="true" />
             
        <PagerStyle Mode="NextPrevNumericAndAdvanced" PagerTextFormat="{4} Records {2} to {3} of {5}" ></PagerStyle>
        <ExportSettings ExportOnlyData="false"></ExportSettings>
             
    </telerik:RadGrid>
            
 
<telerik:RadFormDecorator ID="FormDecoratorMaster" runat="server" DecoratedControls="all">
</telerik:RadFormDecorator>
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"
        RelativeTo="Element" AutoTooltipify="true" ContentScrolling="Default" EnableAriaSupport="true"
        EnableShadow="true" Position="TopCenter"
        Animation="FlyIn"  >
         
</telerik:RadToolTipManager>

protected void RadGridUrl_UpdateCommand(object source, GridCommandEventArgs e)
{
    bool process = true;
    IControlPanelPersistenceProvider persistenceProvider = new ControlPanelDatabaseProvider();
    m_resultMessage.Visible = false;
 
    var editableItem = ((GridEditableItem)e.Item);
    VeM_Invoice invoice = new VeM_Invoice();
 
    invoice.VeM_InvoiceId = (int)editableItem.GetDataKeyValue("VeM_InvoiceId");
 
    //populate its properties
    Hashtable values = new Hashtable();
    editableItem.ExtractValues(values);
 
    int invoiceStatusId = 0;
    int.TryParse((editableItem["InvoiceStatus"].Controls[0] as RadComboBox).SelectedValue, out invoiceStatusId);
    invoice.VeM_InvoiceStatusId = invoiceStatusId;
 
    if (values["DatePaid"] != null)
    {
        invoice.DatePaid = DateTime.Parse((string)values["DatePaid"]);
    }
 
    if (values["InvoiceTotal"] != null)
    {
        try
        {
            invoice.InvoiceTotal = double.Parse((string)values["InvoiceTotal"]);
        }
        catch
        {
            process = false;
            m_resultMessage.Text = "Invoice Total is a numeric value";
            m_resultMessage.Visible = true;
        }
    }
    else
    {
        process = false;
        m_resultMessage.Text = "Invoice Total is required";
        m_resultMessage.Visible = true;
    }
 
    if (values["NumberSales"] != null)
    {
        try
        {
            invoice.NumberSales = int.Parse((string)values["NumberSales"]);
        }
        catch
        {
            process = false;
            m_resultMessage.Text = "Number Sales is a numeric value";
            m_resultMessage.Visible = true;
        }
    }
    else
    {
        process = false;
        m_resultMessage.Text = "Number Sales is required";
        m_resultMessage.Visible = true;
    }
 
    if (values["TotalSales"] != null)
    {
        try
        {
            invoice.TotalSales = double.Parse((string)values["TotalSales"]);
        }
        catch
        {
            process = false;
            m_resultMessage.Text = "Total Sales is a numeric value";
            m_resultMessage.Visible = true;
        }
    }
    else
    {
        process = false;
        m_resultMessage.Text = "Total Sales is required";
        m_resultMessage.Visible = true;
    }
 
    if (values["NumberCancelations"] != null)
    {
        try
        {
            invoice.NumberCancelations = int.Parse((string)values["NumberCancelations"]);
        }
        catch
        {
            process = false;
            m_resultMessage.Text = "Number Cancelations is a numeric value";
            m_resultMessage.Visible = true;
 
        }
    }
    else
    {
        process = false;
        m_resultMessage.Text = "Number Cancelations is required";
        m_resultMessage.Visible = true;
    }
 
    if (values["TotalCancelations"] != null)
    {
        try
        {
            invoice.TotalCancelations = double.Parse((string)values["TotalCancelations"]);
        }
        catch
        {
            process = false;
            m_resultMessage.Text = "Total Cancelations is a numeric value";
            m_resultMessage.Visible = true;
        }
    }
    else
    {
        process = false;
        m_resultMessage.Text = "Total Cancelations is required";
        m_resultMessage.Visible = true;
    }
 
    //Comments
    if (values["Comments"] != null)
    {
        invoice.Comments = (string)values["Comments"];
    }
 
    //InvoiceNumberEdited
    if (values["InvoiceNumber"] != null)
    {
        invoice.InvoiceNumberEdited = (string)values["InvoiceNumber"];
    }
    else
    {
        process = false;
        m_resultMessage.Text = "InvoiceNumber is required";
        m_resultMessage.Visible = true;
    }
 
    invoice.DateUpdated = DateTime.Now;
 
    if (process)
    {
        DataBaseEnum dataBaseEnum = persistenceProvider.SaveInvoice(invoice);
        switch (dataBaseEnum)
        {
            case DataBaseEnum.UpdateOK:
                m_resultMessage.Text = "Invoice Saved";
                m_resultMessage.Visible = true;
                PopulateGrid(true);
                break;
            case DataBaseEnum.UpdateError:
                m_resultMessage.Text = "Error saving the invoice";
                m_resultMessage.Visible = true;
                break;
        }
    }
}
         
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem && !e.Item.IsInEditMode)
    {
        GridDataItem item = (GridDataItem)e.Item;
        Literal invoiceStatus = (Literal)item["InvoiceStatus"].Controls[0];
        invoiceStatus.Text = (string)DataBinder.Eval(item.DataItem, "VeM_InvoiceStatusName");
    }
 
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        //first reference the edited grid item
        GridEditableItem editedItem = e.Item as GridEditableItem;
        GridEditManager editMan = editedItem.EditManager;
 
        GridTextBoxColumnEditor nameDisplayField = editMan.GetColumnEditor("Comments") as GridTextBoxColumnEditor;
        nameDisplayField.TextBoxControl.TextMode = TextBoxMode.MultiLine;
 
        IControlPanelPersistenceProvider persistenceProvider = new ControlPanelDatabaseProvider();
        List<VeM_InvoiceStatus> invoiceStatusCollection = persistenceProvider.ListInvoiceStatus();
 
        GridDropDownColumnEditor invoiceStatusDropdown = editMan.GetColumnEditor("InvoiceStatus") as GridDropDownColumnEditor;
        invoiceStatusDropdown.DataSource = invoiceStatusCollection;
        invoiceStatusDropdown.DataBind();
        invoiceStatusDropdown.SelectedValue = ((Ve.Apps.ConfigurationUI.BusinessObjects.Invoice)editedItem.DataItem).VeM_InvoiceStatusId.ToString();
    }
 
    if (e.Item is GridFilteringItem)
    {
        GridFilteringItem item = e.Item as GridFilteringItem;
        ((item["InvoiceStatus"].Controls[0]) as TextBox).Text = ((item["VeM_InvoiceStatusName"].Controls[0]) as TextBox).Text;
    }
}
 
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    Country country = (Country)Session["cultureInfo"];
    string locale = country.Language;
 
    if (locale != "en")
    {
        TranslationHandler myHandler = new TranslationHandler(locale, Server.MapPath(""));
        if (e.Item is GridPagerItem)
        {
            Button GoToPageLinkButton = (Button)e.Item.FindControl("GoToPageLinkButton");
            GoToPageLinkButton.Text = myHandler.GetString("VeM_Grid_Go");
 
            Button ChangePageSizeLinkButton = (Button)e.Item.FindControl("ChangePageSizeLinkButton");
            ChangePageSizeLinkButton.Text = myHandler.GetString("VeM_Grid_Change");
 
            Label changePageLabel = (Label)e.Item.FindControl("GoToPageLabel");
            changePageLabel.Text = myHandler.GetString("VeM_Grid_Page");
 
            Label lblPageSize = (Label)e.Item.FindControl("ChangePageSizeLabel");
            lblPageSize.Text = myHandler.GetString("VeM_Grid_PageSize");
 
            Label lblPageOf = (Label)e.Item.FindControl("PageOfLabel");
            lblPageOf.Text = myHandler.GetString("VeM_Grid_Of");
 
            RadGrid1.PagerStyle.PagerTextFormat = "{4} " + myHandler.GetString("VeM_Grid_Records") + " {2} " + myHandler.GetString("VeM_Grid_To") + " {3} " + myHandler.GetString("VeM_Grid_Of") + " {5}";
        }
    }
}
 
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
    {
        Pair command = (Pair)e.CommandArgument;
        if (command.Second.ToString() == "InvoiceStatus")
        {
            e.Canceled = true;
            GridFilteringItem filter = (GridFilteringItem)e.Item;
            ((filter["VeM_InvoiceStatusName"].Controls[0]) as TextBox).Text = ((filter["InvoiceStatus"].Controls[0]) as TextBox).Text;
            command.Second = "VeM_InvoiceStatusName";
            filter.FireCommandEvent("Filter", new Pair(command.First, "VeM_InvoiceStatusName"));
        }
    }
}

 

Viktor Tachev
Telerik team
 answered on 27 Jun 2016
5 answers
407 views
Hi,

Is there any way to get the full file name uploaded on the server on client side i.e., if I am uploading a file with the name 'abc.jpg' its been stored on the server as '838238909abc,jpg'. On the client side i need this new name of the file.

Thanks
Veselin Tsvetanov
Telerik team
 answered on 27 Jun 2016
1 answer
84 views

Hello there,

I try to access the function GetRadWindowManager() from my app.ts file.

I added the telerik definitions files and I cannot find a way to call "window.GetRadWindowManager()" or "window.top.GetRadWindowManager()" because the definition is not found...

How can I call that function without errors ?

Thanks for your help !

Brice.
Hamza
Top achievements
Rank 1
 answered on 27 Jun 2016
7 answers
174 views

Hi,

I have an error when I use RadNavigation in the CommandItemTemplate of a RadGrid. I'm using NodeTemplates to nest RadButtons and RadCheckboxes. It works perfectly in desktop mode, but as soon as I reduce the browser to collapse to mobile mode, the nested controls will fire their codebehind okay but then the RadNavigation hangs open and a second click reports a JSON error. I have a couple of days of brain-fade on this now so any help would be greatly appreciated before I start looking for a different approach. It would be a shame if there isn't a way to get this to work because I love the responsiveness of the RadNavigation control. Please see below:

 

My CommandItemTemplate:

</Columns>
<CommandItemTemplate>
<table style="width: 100%">
<tr>
<td style="padding-right: 20px; padding-left: 5px">
<span style="font-size: 16pt"><strong><asp:Label ID="Label2" runat="server" Text="<%$Resources:Resource, PagePackagingTitle %>"></asp:Label></strong></span>
</td>
<td style="width: 100%; text-align: right;">
<telerik:RadNavigation ID="RadNavigation2" runat="server" RenderMode="Auto" Skin="Bootstrap">
<Nodes>
<telerik:NavigationNode ID="NavigationNode10" runat="server">
<NodeTemplate>
<telerik:RadButton ID="RadButton1" runat="server" Text="Refresh" CommandName="RebindGrid" Skin="Bootstrap" Width="120px" Icon-PrimaryIconUrl="~/images/site/new2/Refresh.png"></telerik:RadButton>
</NodeTemplate>
</telerik:NavigationNode>
<telerik:NavigationNode ID="NavigationNode11" runat="server">
<NodeTemplate>
<telerik:RadCheckBox ID="RadCheckBox1" runat="server" BackColor="<%$ AppSettings:bcCurrent %>" Text="Current" Width="120px" Checked="True" OnCheckedChanged="RadCheckBox1_CheckedChanged">
</telerik:RadCheckBox>
</NodeTemplate>
</telerik:NavigationNode>
<telerik:NavigationNode ID="NavigationNode12" runat="server">
<NodeTemplate>
<telerik:RadCheckBox ID="RadCheckBox2" runat="server" BackColor="<%$ AppSettings:bcObsolete %>" Text="Obsolete" Width="120px" OnCheckedChanged="RadCheckBox2_CheckedChanged">
</telerik:RadCheckBox>
</NodeTemplate>
</telerik:NavigationNode>
<telerik:NavigationNode ID="NavigationNode13" runat="server">
<NodeTemplate>
<telerik:RadCheckBox ID="RadCheckBox3" runat="server" BackColor="<%$ AppSettings:bcPkgCancelled %>" Text="Cancelled" Width="120px" OnCheckedChanged="RadCheckBox3_CheckedChanged">
</telerik:RadCheckBox>
</NodeTemplate>
</telerik:NavigationNode>
</Nodes>
</telerik:RadNavigation>
</td>
</tr>
</table>
</CommandItemTemplate>
</MasterTableView>

 

My Error:

Invalid JSON primitive: .Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Invalid JSON primitive: .

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 

[ArgumentException: Invalid JSON primitive: .] System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject() +578 System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +235 System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +79 System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +37 Telerik.Web.UI.RadButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +184 Telerik.Web.UI.RadWebControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +16 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +758 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2570

 

Thanks,

Craig

Veselin Tsvetanov
Telerik team
 answered on 27 Jun 2016
1 answer
91 views

When we are looking at a schedule with a recurring event from 1am to 3am Sunday to Tuesday, the overflow icons showing only on Monday and Tuesday.  It doesn't show up on Sunday.  See attached image as example.

Is there a way to do this?

Peter Milchev
Telerik team
 answered on 27 Jun 2016
2 answers
381 views
Do you have an example of how to pass in an argument (for example an image name) from a javascript function to a radlightbox when it opens?  I want to do something like the below, where the onmouseover in the <img src opens the lightbox if I hard code the value in the <asp:Image.
I need to load different images on different img src tags so I thought passing the image name via the funcion was the cleanest way to do so. 

Is this the best way to do this:
http://www.telerik.com/forums/parameterized-lightbox-show()-functions---how-to-do-it

The disadvantage is that it looks like every image is loaded when the page is rendered, I was hoping it load the image dynamically.
Thanks for your help!



<script type="" >
function loadlb(imageName) {
        var rbx = $find('<%= rlbBox.ClientID %>');
        rbx.show();
}
</script>

<telerik:RadLightBox Modal="true" RenderMode="Auto" ClientIDMode="Static" ID="rlbBox" runat="server" ShowCloseButton="true">
        <ClientSettings><AnimationSettings></AnimationSettings></ClientSettings>
        <Items>
            <telerik:RadLightBoxItem>
                <ItemTemplate>
<asp:Image runat="server" ImageUrl="<image_from_loadlb>"/> 
                </ItemTemplate>
            </telerik:RadLightBoxItem>                 
        </Items>
</telerik:RadLightBox>


<img src=<some image> onmouseover="loadlb('imageToLoad'.jpg')" >
mack
Top achievements
Rank 1
 answered on 27 Jun 2016
3 answers
202 views

I have the following two RadListBoxes defined to allow switching items between them. All was well until I defined OnInserted and OnDelted, which fail to fire.

I  need to take action when anything is added to or removed from the right list box. This is they only way I'm aware of doing it, but like I said the events don't fire.

Here's the associated code:

<telerik:RadListBox runat="server" ID="rlbxAvailableRoles" Height="210" Width="230" AllowTransfer="true" TransferToID="rlbxSelectedRoles"
    ButtonSettings-AreaWidth="35px" AllowTransferOnDoubleClick="true" ButtonSettings-ShowTransferAll="false">
    <HeaderTemplate>
        <h3>Available Roles</h3>
    </HeaderTemplate>
</telerik:RadListBox>
<telerik:RadListBox runat="server" ID="rlbxSelectedRoles" Height="210" Width="190" EmptyMessage="Select at least one role"
    OnInserted="rlbxSelectedRoles_Inserted" OnDeleted="rlbxSelectedRoles_Deleted">
    <HeaderTemplate>
        <h3>Selected Roles</h3>
    </HeaderTemplate>
</telerik:RadListBox>

protected void rlbxSelectedRoles_Inserted(object sender, RadListBoxEventArgs e)
{
    LoadPrimaryRoleDropdown();
}
 
protected void rlbxSelectedRoles_Deleted(object sender, RadListBoxEventArgs e)
{
    LoadPrimaryRoleDropdown();
}

 

 

Any help would be appreciated

Ivan Danchev
Telerik team
 answered on 27 Jun 2016
3 answers
799 views
Hi,
I would like to edit a gridhyperlinkcolumn's navigateurl in my code behind. I have tried:
RadGrid grid = (RadGrid)sender;
GridColumn column = grid.Columns.FindByUniqueName("ViewBus");
(column as GridHyperLinkColumn).NavigateUrl = "www.google.ca";


in both the PreRender and DataBound events. Any suggestions?
Eyup
Telerik team
 answered on 27 Jun 2016
1 answer
115 views

Hi, 

I have Activity object which has childActivity which is a dynamic data type.

DataSource to grid is list of Activity.

How can assign few columns of grid with values of child object.

I was trying like below code.

 col.UniqueName = item.Name;

col.HeaderText = item.DisplayName;
(col as GridDateTimeColumn).DataField =  Activity.childActivity.Name;

 

Viktor Tachev
Telerik team
 answered on 27 Jun 2016
1 answer
149 views

Here is my code:

 

function RadGrid1_Command(sender, args) {
               var commandName = args.get_commandName();
               if (commandName == "RebindGrid")
               {                  
                   var editedrow = args.get_itemIndexHierarchical();

                   //var itemIndex = args.get_commandArgument();

                   var master = $find('<%= RadGrid1.ClientID %>').get_masterTableView();
 
                   $.ajax({
                       type: "POST",
                       url: "Default.aspx/...",
                       data: "{year: 1}",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function (data) {
                           var response = data.d;
                           alert(response.message);
                       }
                   });
               }               
           }

I can't get the row index from get_itemIndexHierarchical() (JS error function does not exist). Also get_commandArgument() is blank if  I try that.

 

Can anyone help?

Viktor Tachev
Telerik team
 answered on 27 Jun 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?