Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
242 views
Hi,

I would like to use RadChart in my web application. I would like the radchart to show real time data to the customers over web.

Could anyone please let me know whether ASP.NET chart control supports live charting or do I need to go for silverlight control??

Thanks,
Mahesh
Kalyan
Top achievements
Rank 1
 answered on 22 Oct 2012
4 answers
280 views
Hi,
my client wants to see a combobox where he could write patterns of items while list of all items containing the pattern is decreased.
At the same time he wants that the items will be shown with check boxes so at the end of operation he could check several of them
.
I have learned all examples that you show in your demo projects but did not find exactly what I want. Particularly I tried to use CheckBoxes property but then I found in http://www.telerik.com/help/aspnet-ajax/combobox-usability-checkboxes.html that
"Load On Demand functionality is not supported".  Really when I tried this option with empty list of RadComboBoxItems the application stopped to react.
Also I tried to use template based on ideas from http://www.telerik.com/community/forums/aspnet-ajax/combobox/add-item-template-to-radcombobox-dynamically.aspx
But I use handler of ItemsRequested  event. I succeeded to show a combo with check boxes whose number of items is decreased when an user inserts some text. But when I let to combo to be closed and then tried to open it I get an error: The state information is invalid for this page and might be corrupted.
I add some code then I use.
So the question: is it possible to realize the above task?
  Thank you
Evgeny

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
  
  
public partial class TestPages_TestComboCheckBoxes : System.Web.UI.Page
{
  
    protected void Page_Init(object sender, EventArgs e)
    {
        //this is name of combo
        rcbMitkanKav.ItemTemplate = new ItemTemplate();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
  
        if (!IsPostBack)
            LoadData();
    }
  
    protected void rcbMitkanKav_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        DataTable dtMitkanimKavim = new DataTable();
        const string MethodName = "SearchPopWindow.rcbMitkanKav_ItemsRequested";
          
  
        int UserErrorCode = 6;
        try
        {
            string sComboText = e.Text;
            //pattern to search
            string sSearchLetter = "";
            if (sComboText == "")
            {
                sSearchLetter = "";
            }
            if (sComboText != "")
            {
                sSearchLetter = sComboText;
            }
  
            try
            {
                if (sSearchLetter.Length < 3)
                    return;
                int queryId = 1;
                dtMitkanimKavim = GetSearchResultByWord(sSearchLetter, queryId);
                int itemsPerRequest = 30;
                int itemOffset = e.NumberOfItems;
                int endOffset = itemOffset + itemsPerRequest;
                if (endOffset > dtMitkanimKavim.Rows.Count)
                {
                    endOffset = dtMitkanimKavim.Rows.Count;
                }
                if (endOffset == dtMitkanimKavim.Rows.Count)
                {
                    e.EndOfItems = true;
                }
                else
                {
                    e.EndOfItems = false;
                }
  
  
  
                rcbMitkanKav.DataSource = dtMitkanimKavim;
                rcbMitkanKav.DataBind();
               
  
  
                 
            }
            catch
            {
                e.Message = "אין רשומות";
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
  
  
  
    private void LoadData()
    {
        try
        {
            ///here code to load data from database int a table and save it in Session
  
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
  
    /// <summary>
    /// 
    /// </summary>
    /// <param name="sSearchWord">curren input</param>
    /// <param name="queryId"></param>
    /// <returns></returns>
    public DataTable GetSearchResultByWord(string sSearchWord, int queryId)
    {
        DataTable dt = new DataTable();
        //build new datable is contain two columns
        dt.Columns.Add("ComboValue");
        dt.Columns.Add("ComboText");
  
  
        DataRow newRow = null;
        string currentValue = string.Empty;
        ///array of rows from a table according to current input sSearchWord
        DataRow[] drSelected = null;
        ///replace "'" to sql select
        if (sSearchWord.Contains("'"))
            sSearchWord = sSearchWord.Replace("'", "''");
        try
        {
            drSelected = SessionManager.dtMitkanimKavim.Select("NameReferenceId LIKE '" + "%" + sSearchWord + "%" + "'") as DataRow[];
            //add array to new datable
            foreach (DataRow row in drSelected)
            {
                 
                dt.Rows.Add(row);
            }
        }
        catch (Exception ex)
        {
  
            throw ex;
        }
        return dt;
    }
  
  
      
     
  
     
}
class ItemTemplate : ITemplate
{
  
    public void InstantiateIn(Control container)
    {
  
        CheckBox chk = new CheckBox();
        //chk.ID = "chk1";
        chk.Attributes.Add("onclick", "SetCheckedStateToServer()");
  
  
        Label lbl = new Label();
  
  
  
        Table table = new Table();
        TableRow mainRow = new TableRow();
  
        TableCell cell1 = new TableCell();
        cell1.Controls.Add(chk);
        cell1.DataBinding += new EventHandler(cell1_DataBinding);
        mainRow.Cells.Add(cell1);
  
        TableCell cell2 = new TableCell();
        cell2.Controls.Add(lbl);
        cell2.DataBinding += new EventHandler(cell2_DataBinding);
        mainRow.Cells.Add(cell2);
  
        table.Rows.Add(mainRow);
  
        container.Controls.Add(table);
    }
  
    private void cell1_DataBinding(object sender, EventArgs e)
    {
  
        TableCell target = (TableCell)sender;
  
        (target.Controls[0] as CheckBox).Checked = true;
    }
  
    private void cell2_DataBinding(object sender, EventArgs e)
    {
        TableCell target = (TableCell)sender;
        RadComboBoxItem item = (RadComboBoxItem)target.BindingContainer;
  
        (target.Controls[0] as Label).Text =
            ((DataRowView)(item.DataItem)).Row[1].ToString();
    }
  
  
  
}
eugen100
Top achievements
Rank 1
 answered on 22 Oct 2012
1 answer
139 views
I have 2 columns in my datasource(not in the grid) that I want to access in order to format columns that I do have in the grid. I am applying my formatting in the ItemDataBound event.
Scenario:
Let's say my datasource has 4 columns. Select Field1, Field2, Field3, Field4 from myTable. In the grid I have Field1 with Unique column name "Field1" and Field2 with Unique column name "Field2". Can I access Field3 and Field4 from the datasource(not the grid) and format Field1 and Field2 with values that I analyze  in fields 3 and 4?
I know I can access Fields 3 and 4 if I put them in the grid with "display=false", but I fear this just adds more unecessary html in the grid(and I have 8 grids on the form). I seem to remember something about accessing the MasterTableView, but I can't find the post anywhere.

Thanks in advance,

Dana Cobb
Shinu
Top achievements
Rank 2
 answered on 22 Oct 2012
1 answer
120 views
Hi All,

In Rad list box, if we select "<ButtonSetting ShowReorder = "true">" then we get button only for "Move UP" and "Move Down" as shown in attached image "Verticle.png".
However, i require buttons "Move Left" and "Move Right" as shown in attached image "Horizontal.png".

What changes require to get this?
Dipal
Top achievements
Rank 1
 answered on 22 Oct 2012
1 answer
122 views
I have a radPanelbar, and ItemClick server side event attached to it. But this event is not firing when i click on the expand button of the item. What exactly i need to do in order to execute the code in the ItemClick event when the expand button is clicked.

Thanks in advance.
<telerik:RadPanelBar runat="server" ID="rpbFilters" ExpandMode="FullExpandedItem" Skin="Windows7">
               <Items>
                              <telerik:RadPanelItem Text="Item1" Expanded="False">
                                             <ContentTemplate>
                                                            <telerik:RadListBox runat="server" ID="radChkList1" ClientIDMode="Inherit" CheckBoxes="true" >
                                                            </telerik:RadListBox>
                                             </ContentTemplate>
                              </telerik:RadPanelItem>
                              <telerik:RadPanelItem Text="Item2" Expanded="False">
                                             <ContentTemplate>
                                                            <telerik:RadListBox runat="server" ID="radChkList2" ClientIDMode="Inherit" CheckBoxes="true" >
                                                            </telerik:RadListBox>
                                             </ContentTemplate>
                              </telerik:RadPanelItem>
               </Items>
</telerik:RadPanelBar>
 
 
 Private Sub rpbFilters_ItemClick(sender As Object, e As Telerik.Web.UI.RadPanelBarEventArgs) Handles rpbFilters.ItemClick
               'Load data
End Sub
Princy
Top achievements
Rank 2
 answered on 22 Oct 2012
1 answer
68 views
Hallo there

I have a grid with a grid table view inside. I automatically expand all rows. But i would like to hide the expand column. Can you provide a solution in css. thanks in advance
allen

Princy
Top achievements
Rank 2
 answered on 22 Oct 2012
1 answer
70 views
hi.
how r u.

can you help me?

i have a web form data entry. it has a RadGrid and some RadTexBoxes to insert and update out of RadGrid.
my problem:
 after update data by TextBoxes, when call DataBind method from RadGrid all of States in RadGrid Losts.
the sort, filter, ....

how can i resolve this problem?

(excuse me for my bad english skill ;)  )
Shinu
Top achievements
Rank 2
 answered on 22 Oct 2012
1 answer
114 views

<telerik:RadGrid ID="grdIn" runat="server" OnLoad="grdIn_OnLoad" OnNeedDataSource="grdIn_NeedDataSource"

                                    SkinID="CR" GridLines="None" AllowPaging="True"  AutoGenerateColumns="False" OnItemDataBound="grdIn_ItemDataBound"

                                    AllowMultiRowSelection="true" Width="925px">

                                    <MasterTableView PageSize="10"

                                        DataKeyNames="ID">

                                      

                                        <NoRecordsTemplate>

                                            <div style="text-align: left; width: 100%">

                                                <asp:Label ID="lblEmptyMsg" runat="server" meta:resourcekey="lblEmptyMsg2Resource1"></asp:Label></div>

                                        </NoRecordsTemplate>

                                    </MasterTableView>

                                    <PagerStyle AlwaysVisible="True" />

                                    <ClientSettings EnableRowHoverStyle="true">

                                        <Selecting AllowRowSelect="True" />

                                        <Scrolling AllowScroll="True"></Scrolling>

                                        <ClientEvents OnGridCreated="GridCreated" />

                                    </ClientSettings>

                                </telerik:RadGrid>



 protected void btne_Click(object sender, EventArgs e)
    {
          foreach (Telerik.Web.UI.GridItem objGrdItem in grdIn.Items)
            {    if (objGrdItem.Selected)
                {
                   int Id = (int)(objGrdItem.OwnerTableView.DataKeyValues[objGrdItem.ItemIndex]["ID"]);
                 
                 }
            }

}






Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Oct 2012
1 answer
74 views
I have a Radgrid in one of the columns of main Radgrid.

Display of rows is working fine.

I need to open all the rows of child radgrid when I click the edit on main row.

How do I do this?

Thanks
  
Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Oct 2012
0 answers
110 views
Hello

I am considering the following scenario: I have working asp.net web site with radscheduler (option with webservice binding). Everything is working fine but I would like to add such scheduler to winforms application. I have been trying to consume SchedulerWebService (this is a part of asp.net page) but I have found it is json service so it is not such easy as I thought - there are deserialization problems..
Do you have any advices? My webservice method is as follows
public List<AppointmentData> GetJSONScheduler(SchedulerInfo schedulerInfo)

I am succesfully receiving appointments but I can't deserialize List<AppointmentData> from json response.
I have been trying
but I am receiving e

DataContractJsonSerializer dJSON =
new DataContractJsonSerializer(typeof(List<AppointmentData>);
List<AppointmentData> sr = (List<AppointmentData>)dJSON.ReadObject(str);
//sbResponse is taken from the stream of webrequest response
JavaScriptSerializer jscriptDeserializer = new JavaScriptSerializer();
jscriptDeserializer.RecursionLimit = 100;
List<AppointmentData> srResult = jscriptDeserializer.Deserialize<List<AppointmentData>>(sbResponse.ToString());
xceptions about root element is missing or value __type cannot be null..
I would like to avoid string manipulation with the response (replacing elements with proper types)
Or do you have easier solution for such operations?
Solution with direct access to db is unacceptable - I am performing few operations with appointments before I am returning it to the client and I would like to have such method in one place
One web service, many clients (wpf, winforms, asp.net)..

Thanks in advance
Regards
host
Top achievements
Rank 1
 asked on 21 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?