Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
Hi all,

First of I'm not sure this is the right place for my question, but I could't find a more appropriate.  

On a web page I have have sidebar and main content area. In the main content is a RadGrid with a collections of products of a selected product category. In the sidebar I have User control where the user can filter the product in the grid. This QuickFilter user control have a RadPanelBar and in every panel is a CheckBoxList. This UI of the was requirement from the client.

 The RadPanelBar Items and the CheckBVoxLists are created dynamic because that the number of filter categories (panels in the RadPanelBar) and the number of filter options (check boxes in the CheckBoxList) are different from one product category to another.
In the Page_Inet of the user control I create the RadPanelItems and the CheckBoxLists, so that they an there values are been persisted in the ViewState. In OnClick event of a button I read out the selected check boxes and query the database for the RaGrid and do a Rebind op the grid.
This works as expected.

But now build in a "Brand" selector. I's simple two RadioButtons sitting in the sidebar. In the SelectedIndexChange I have to build the Filter User Control again because that the filter categories and filter options are different between the two Brands.

But because the SelectedIndexChange fires after the Page_Init the new build RadPanelBar items en check boxes are not added to the ViewState. and therefor the selected values aren't persisted.

I have tried to build the RadPanelBar items en check boxes again on the SelectedIndexChange but this seems to work.

I would like just to refresch the Filter User Control in the SelectedIndexChange so that the Page_Init was fired again. Is this possible/ Or can I add the dynamic created controls and the value to the ViewState?

Or is there another solution?

Anders Pedersen
Ianko
Telerik team
 answered on 22 Apr 2014
1 answer
271 views
Hi,

i have created a radhtmlchart dynamically using c# code , now i want to create OnClientSeriesClicked event for this chart and through this event i want to call a java script function ,
what i am doing is that i am creating radhtmlchart using c# code and adding it to panel, this i have achived so far but now i want that when we click on the series of the chart some java scrip funtion should fire, i am not getting clear idea how to achive this .

till now what i have done is below (just a refernce).
create chart()
{
  RadHtmlChart1 = new RadHtmlChart();
               StyleChart();
               RadHtmlChart1.OnClientSeriesClicked += new EventHandler(this.SeriesClicked);
panel p = new panel();
p.controls.add(RadHtmlChart1 )
}

   private void SeriesClicked(object sender, EventArgs e)
      {
         ClientScript.RegisterStartupScript(this.GetType(), "print", "<script>RadHtmlChart1_SeriesClicked();</script>");
         
      }

but i am getting a runtime exception if iam doing this way ("Microsoft JScript runtime error: 'System' is undefined");
Danail Vasilev
Telerik team
 answered on 22 Apr 2014
1 answer
52 views
Hi,I have a RadGrid that has a mastertable and detail tables. Detail tables are loading with "DetailTableDataBind".

I want to sort mastertable and detail tables but their data structure are different. When i try to sort detail table only, it worked. but when i added a sort function to mastertable, it overrides the detail tables' sort function.

Can i sort them seperately with different functions.

Thanks.
Shinu
Top achievements
Rank 2
 answered on 22 Apr 2014
1 answer
66 views
Hi iam having one aspx page in my application. after running it iam getting some extra blank width in right side how to avoid this please help me. .
Vessy
Telerik team
 answered on 22 Apr 2014
9 answers
285 views
Hi everyone! I'm working on a WebPart containing a RadGrid created programmatically (by code behind) with a filterchecklist; There are 3 aspects that I would like to ask for help:

1) RadGrid1.MasterTableView.FilterExpression is always an empty String! I need to use it in the handler method for "OnNeedDataSource" to filter the grid:

            String filterExpression = RadGrid1.MasterTableView.FilterExpression;
            DataFiltered = Data.Select(filterExpression, Data.Columns[0].ColumnName + " ASC").CopyToDataTable();
            RadGrid1.DataSource = DataFiltered;

But when i check\uncheck items of checklist or use the "Classic" filter it does not work and is always an empty String.

2) I need for my purpose to check\uncheck the items of the checklist programmatically based on informations that i only know in the code behind; since the attribute Checked for an element of type RadListBoxItem doesn't work, my idea is to save this information within the handler method for OnFilterCheckListItemsRequested, for example within the attribute "Item.value":

        public void RadGrid1_NeedCheckListItems(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
          ........
                RadListBoxItem Item = new RadListBoxItem();
                Item.Text =Convert.ToString(Data[row_index][col_index]);
                Item.Value = isFiltered? "FILTER" "NOFILTER";
                e.ListBox.Items.Add(Item);
          ........
        }

In the .aspx page of the webpart, I can check the e.ListBox.Items elements using the following code:

       var gridPrototype = Telerik.Web.UI.RadGrid.prototype;
       gridPrototype._checkListItemsRequestedHandlerOriginal = gridPrototype._checkListItemsRequestedHandler;
       gridPrototype._checkListItemsRequestedHandler = function () {
            this._checkListItemsRequestedHandlerOriginal(); // call the origianl method
            var filterCheckList = $find(this._filterCheckListClientID); // get the check list
            var column = this._checkListFilterActiveColumn.get_uniqueName(); // get the active column
            filterCheckList.get_items().getItem(0).check(); // check the first item for example
       }

How can i access the length of the listbox and the attribute "value" of a single item? My purpose is to scan the listbox until its end (that's why i need the length of this list) and check the attribute "value" of a single item to decide if check or uncheck this RadListBoxItem?
Is it also possible to set the attribute "value" to modify it after you've read it?

3) Less important thing, As you can see in the attached file, what tag i can use in the ".RadFilterMenu_CheckList css class" to make sure that "Cancel" button is alligned with "Apply" button?

Thanks in advance, (unfortunately without the source code i don't know where to find these informations).

Regards,
Carla

Kostadin
Telerik team
 answered on 22 Apr 2014
4 answers
181 views
Hi

I am using RadGrid and I need to export it to email.
I looked in your forums and found this answer:

VB.NET:
01.Private Sub RadGrid1_GridExporting(sender As Object, e As GridExportingArgs) Handles RadGrid1.GridExporting
02. 
03.    If isLoc <> True Then
04. 
05.        Dim ms As New MemoryStream(New UTF8Encoding().GetBytes(e.ExportOutput))
06. 
07.        Dim smtpClient As New SmtpClient()
08.        smtpClient.EnableSsl = True
09. 
10.        Dim mailMessage As New MailMessage()
11.        mailMessage.IsBodyHtml = True
12.        mailMessage.[To].Add(New MailAddress(Session("Email")))
13.        mailMessage.Subject = "Reporting service - Do Not reply"
14.        mailMessage.Body = "This report was sent from <br /><b>Reporting service</b> "
15.        mailMessage.Attachments.Add(New Attachment(ms, "Reporting service" & DocType))
16.        Try
17.            smtpClient.Send(mailMessage)
18.            'Label1.Text = "Message Sent" 
19.            MsgBox("Message Sent")
20.        Catch ex As Exception
21.            'Label1.Text = ex.ToString()
22.            MsgBox("Message not Sent")
23.        End Try
24.         
25.        Response.Redirect(Request.Url.ToString())
26.         
27.         
28. 
29.    End If
30.End Sub


The code in line 25 is not good for my project
because if I use the Response command it does a PostBack.
In my project the PostBack resets user configuration.
And if I delete the Response command, it sends an email and also creates a file in the user's computer.

I want only to send an email without PostBack and without creating a file in the user's computer.
How can I do that?

Thanks,
Daniel.



Daniel
Telerik team
 answered on 22 Apr 2014
1 answer
71 views
Hi

Could you please let me know how to accomplish simple drag and place row in the same grid,  

  <ClientSettings AllowRowsDragDrop="true" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
            <ClientEvents OnRowContextMenu="RowContextMenu" />
                  
            <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
              <Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>

Do i have to maintain any list in codebehind for this? Please let  me know
Shinu
Top achievements
Rank 2
 answered on 22 Apr 2014
1 answer
50 views
Hello, I am working with vb .net and within an existing project that uses telerik, i imported some user controls.

My hope is to convert existing controls to rad controls, however when adding a rad button...or any control..
I get the following error

"The Controls collection cannot be modified because the control contains code blocks"

steps i have taken to try to correct issue are as follows.
1.  I changed <%= to <#=
2.  wrapped JavaScript around a RadCodeBlock
3. Attempted a radscriptmanger but i already have one declared so error occurs. 

I do not know what to try at this point.
As expressed this is an existing project, the only thing that might be a curveball is.
This imported code is called from a radwindow and is created as a modal window.
Within the aspx page, are the user controls that i am attempting to replace existing with telerik.

When a radwindow is open, do i lose anything that i must declare again?
As expressed it is aware of the script manager. 

What could i be missing? At wits end.

Thank you



Princy
Top achievements
Rank 2
 answered on 22 Apr 2014
9 answers
319 views
Hi Telerik user,

I have tried to implement export to excel functionality in radgrid but encounter issue with filename setting.
From the file download window after I fire exportToExcel() function from javascript:
When I click on open, the filename is not shown correctly (It shows page name instead of filename) but
When I click on save and put the file in a folder and then open the file, it shows correct filename.

I have tried to put filename as a parameter to exportToExcel(filename) but it is still showing incorrect filename.

Here is my code snippet:

<script type="text/javascript" language="javascript">  
    function Export() {  
        var masterTable = $find('RadGrid1').get_masterTableView();  
        if (masterTable != null)  
            masterTable.exportToExcel();  
    }  
</script> 
 
        <telerik:RadGrid ID="RadGrid1" ShowStatusBar="True" Height="360px" 
            runat="server" AutoGenerateColumns="False" AllowSorting="false"   
            GridLines="None" ShowFooter="false" EnableDrag="false" 
            OnNeedDataSource="RadGrid1_NeedDataSource" ExportSettings-FileName="NostroTransfer" 
            OnItemDataBound="RadGrid1_ItemDataBound"

Please share if you have ever encountered this issue.

Regards,
Canfield
Daniel
Telerik team
 answered on 22 Apr 2014
5 answers
67 views
hey every one
i am using web http://demos.telerik.com/aspnet-ajax/webmail problem is that if net connection not availble the whole website has been crashed . In an Attachment is the output of crash web, how to fix this. please help me 

thanks in advance.
Plamen
Telerik team
 answered on 22 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?