Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
108 views
Hello everyone,

I'm having problem with RadCombox here is my ASPX Code and i'm binding data using WCF

<telerik:RadComboBox ID="cmb" runat="server" Width="250px" Height="200px"
  Skin="Windows7" MarkFirstMatch="true" AllowCustomText="false" OnSelectedIndexChanged="cmb_SelectedIndexChanged"
  EmptyMessage="Select a Referral" EnableLoadOnDemand="true" DropDownAutoWidth="Enabled"
  EnableAutomaticLoadOnDemand="true" ItemsPerRequest="10" ShowMoreResultsBox="true"
  EnableVirtualScrolling="true" OnClientSelectedIndexChanged="onSelectedIndexChanged"
  AutoPostBack="true">
  <WebServiceSettings Method="GetLookup" Path="../Services/CommonService.svc" />
</telerik:RadComboBox>


here is my WCF method

[OperationContract]
    public RadComboBoxData GetLookup(RadComboBoxContext context)
    {
      RadComboBoxData result = new RadComboBoxData();
      List<Lookup> lst = null;
      try
      {
        lst = Data.GetLookup();
        if (lst != null)
        {
          var alll = from rl in lst
                            orderby rl.Name
                            select new RadComboBoxItemData
                            {
                              Text = rl.Name,
                              Value = Convert.ToString(rl.Id)
                            };
 
          string text = context.Text.Trim().ToLower();
          if (!String.IsNullOrEmpty(text))
          {
            alll = alll.Where(item => item.Text.Trim().ToLower().Contains(text));
          }
 
          int numberOfItems = context.NumberOfItems;
          var ls = alll.Skip(numberOfItems).Take(10);
          result.Items = ls.ToArray();
 
          int endOffset = numberOfItems + ls.Count();
          int totalCount = alll.Count();
 
          if (endOffset == totalCount)
            result.EndOfItems = true;
          result.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>",
                                         endOffset, totalCount);
        }
      }
      catch (Exception ex)
      {
        throw ex;
      }
 
      return result;
    }


i have attached error message Image that get fired when i selecting one of list from RadComboBox

Please help me ,
Kiresh
Top achievements
Rank 1
 asked on 12 Apr 2013
1 answer
155 views
Can I dynamic adding data to TreeList instead of using dataSource? it just like DataTable, we can add column and row by using behind code programming:

 Dim data As New DataTable
  data.Columns.Add("textHeader", GetType(String))
   data.Columns.Add("valueHeader", GetType(String))
 data.Rows.Add("text1", "value1")
 data.Rows.Add("text2", "value2")

Shinu
Top achievements
Rank 2
 answered on 12 Apr 2013
3 answers
124 views
I need to get the number of child nodes of a treelist node.
But the instruction item.ChildItems.Count is always zero.
What I am doing wrong.



    
protected void RadTreeList1_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
    {
        if (e.Item is TreeListDataItem)
        {
            TreeListDataItem item = e.Item as TreeListDataItem;
 
            int numberOfChilds = item.ChildItems.Count;
 
 
....
Shinu
Top achievements
Rank 2
 answered on 12 Apr 2013
2 answers
105 views
Is it possible in code-behind to get formatting info (e.g., font name, font size, font colour, bold, justification, cell colour) of a specific cell?
Neil N
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 11 Apr 2013
1 answer
125 views
Hi Team,

I am using telerik rad chart in c#.net, how to apply the 3D feature to my stacked bar chart, is there any possiability with out using silverlite, can you please suggest.


Thanks in advance.
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 11 Apr 2013
1 answer
105 views
Hi,

I have a main grid with two hierarchical levels, the main level, and the child level. I am trying to insert record on the main level, and then once I have that record inserted, be able to insert a record onto the child record of that record, but insert it using the same ID as the main record. I already looked at this demo, http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultvb.aspx,
 and it is from where I am getting my bases from, but I am having difficulty when trying to insert a record onto the child level. I am using DatabaseAccessors not SQL connection strings or SQL Commands, I am working in vb.net. I am not sure how to save the fields being inputted, or if there is a way to treat the insert commands for the child table the same as the main table. 
Michael
Top achievements
Rank 1
 answered on 11 Apr 2013
4 answers
142 views
I have a requirement where I need to  have a GridCalculated column inside a GridTemplateColumn. I tried to search online but could not an answer to it.
when I try to add it I get an error.
Is it possible to have a GridCalculatedColumn inside a GridTemplateColumn? If yes then I would need a way to update it client side if a User changes a value.

Thanks
Pooja
Top achievements
Rank 1
 answered on 11 Apr 2013
1 answer
149 views
Consider:

I am dynamically creating a toolbar that has a RadComboBox button, such that I do the following:

' in the page_load:
 
If Not m_ThisPage.IsPostBack Then
   Dim btnSearchByTxt As New RadToolBarButton()
   btnSearchByTxt.Text = "SearchFor"
   btnSearchByTxt.Value = "searchfor"
   m_RadToolBar.Items.Add(btnSearchByTxt)
 
   InstantiateSearch()
   Dim cboSearchItem As RadToolBarItem = m_RadToolBar.FindItemByText("SearchFor")
   Dim cboSearchBox As RadComboBox = CType(cboSearchItem.FindControl("SearchComboBox"), RadComboBox)
   AddHandler cboSearchBox.SelectedIndexChanged, AddressOf cboSearchBox_SelectedIndexChanged
 
End If
 
' -------------- snip ----------------
 
    Private Sub InstantiateSearch()
 
        Dim searchTemplate As New ComboBoxSearchTemplate
        Dim cboSearchItem As RadToolBarItem = m_RadToolBar.FindItemByText("SearchFor")
        'Dim searchTemplate2 As New TextBoxSearchTemplate()
        'Dim textSearchItem As RadToolBarItem = m_RadToolBar.FindItemByText("SearchFor")
        If TypeOf cboSearchItem Is RadToolBarButton Then
            searchTemplate.InstantiateIn(cboSearchItem)
        End If
 
        m_RadToolBar.DataBind()
 
    End Sub
 
    Private Class ComboBoxSearchTemplate
 
        Implements ITemplate
 
        Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
 
            Dim cboBox1 As New RadComboBox()
 
            cboBox1.ID = "SearchComboBox"
            cboBox1.DropDownWidth = 460
            cboBox1.Sort = RadComboBoxSort.Ascending
            cboBox1.SortCaseSensitive = False
            'cboBox1.DropDownCssClass = "searchDropDown"
            cboBox1.AllowCustomText = True
            cboBox1.AutoPostBack = True
            cboBox1.EmptyMessage = "Search for..."
            cboBox1.EnableItemCaching = True
            cboBox1.EnableLoadOnDemand = True
            cboBox1.MaxHeight = 320
            cboBox1.MaxLength = 2999
            cboBox1.Width = 250
            cboBox1.ExpandDelay = 2500
            cboBox1.LoadingMessage = "Searching..."
            cboBox1.Attributes.Add("onitemsrequested", "SearchComboBox_ItemsRequested")
            'cboBox1.Attributes.Add("onkeydown", "fire()")
            cboBox1.OnClientKeyPressing = "fire"
            cboBox1.CloseDropDownOnBlur = False
            cboBox1.Text = ""
            cboBox1.Font.Size = 9
            cboBox1.Font.Bold = False
            cboBox1.Font.Name = "Sans-Serif"
 
            cboBox1.DataTextField = "CMM_DESCRIPTION"
            cboBox1.Items.Add(New RadComboBoxItem(""))
 
            Dim ctt As ComboBoxTreeTemplate = New ComboBoxTreeTemplate
            ctt.InstantiateIn(cboBox1.Items(0))
 
            AddHandler cboBox1.DataBinding, AddressOf cboBox1_DataBinding
            AddHandler cboBox1.ItemsRequested, AddressOf cboBox1_ItemsRequested
            cboBox1.DataBind()
 
            container.Controls.Add(cboBox1)
 
        End Sub
 
    End Class
 
    Private Class ComboBoxTreeTemplate
 
        Implements ITemplate
 
        Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
 
            Dim rtv As RadTreeView = New RadTreeView()
 
            rtv.ID = "RadTreeView1"
            rtv.Skin = "Telerik"
            rtv.SingleExpandPath = True
 
            rtv.DataTextField = "CMM_DESCRIPTION"
            rtv.DataValueField = "CMM_ID"
            rtv.DataFieldParentID = "CMM_PARENT_ID"
 
            Dim sProc As String = "sptMaterialInventory_AddEdit_GetCommodity"
            Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("TRACURATEConnectionString").ConnectionString)
            Dim adapter As New SqlDataAdapter(sProc, connection)
            adapter.SelectCommand.CommandType = CommandType.StoredProcedure
            Dim dataTable As New DataTable()
            adapter.Fill(dataTable)
            rtv.DataSource = dataTable
            rtv.DataBind()
            container.Controls.Add(rtv)
 
        End Sub
 
    End Class

The idea is that I want to populate the combobox in the toolbar, with a treeview.  First, for some reason, the treeview is flat.  If I use the same stored procedure in a treeview that I create in ASPX, it renders perfectly.  Using the exact same in this dynamic fashion, there are no parents/children.  Just a flat list of all nodes.

Second: the treeview is fine the first rendering of the page.  When an AJAX post-back occurs, I get an error stating that the treeview does not exist.

I am looking for two answers:

1) How do I get the full treeview with parent/children to render?
2) How do I cause the treeview to not disappear after the first AJAX post-back?

I hope that this is enough code for you to understand what I am doing.

Thank you,

Tomas

Tomas
Top achievements
Rank 1
 answered on 11 Apr 2013
3 answers
281 views
We have inherited a project that uses RADGrid.  It has both events for double and single clicking enabled.

I saw this forum post:
http://www.telerik.com/community/forums/aspnet-ajax/grid/rowclick-amp-rowdoubleclick.aspx
Reading through your documentation, EnablePostBackOnRowClick should be set to false by default, but I tried setting it explictly and I am still experiencing the problem.  I put breakpoints in Javascript on the rowclick and rowdblclick events, and rowdblclick never fires; rowclick fires twice.

I did notice that your Silverlight controls have a mouse speed, and that your scheduler product has something that needs to be reset that keeps track of state.  Is there anything comparable in the Grid?  Any other tips or gotchas to making this work correctly?

Thanks,
Rebecca
Daniel
Telerik team
 answered on 11 Apr 2013
0 answers
182 views

I have a few web forms that proccess excel files, so in order to make this easier, I have a base class like this:

public abstract class ExcelImporter : Page {
    public abstract RadAsyncUpload FileUpload { get; }

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        if (FileUpload != null)
        {
            DefineRadAyncUpload();
        }
    }

    private void DefinirRadAyncUpload()
    {
        FileUpload.Skin = Skin;
        FileUpload.Culture = new System.Globalization.CultureInfo("pt-BR");
        FileUpload.TemporaryFolder = "~/temp";
        FileUpload.OnClientFileUploaded = "PostBackAsyncUploadComplete";
        FileUpload.AllowedFileExtensions = new[] { "xls", "xlsx" };
        FileUpload.MaxFileInputsCount = 1;
        FileUpload.FileUploaded += FileUploadOnFileUploaded;
    }

    protected abstract void FileUploadOnFileUploaded(object sender, FileUploadedEventArgs fileUploadedEventArgs);
}

Everything i'm setting in the Define method is working, except the extension filter. What am I doing wrong? is there another moment that I shoud set this property?

Thiago
Top achievements
Rank 1
 asked on 11 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?