Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
168 views

Greetings,

How i can get SelectedItemIndex in listview to client-side?

Regards,

Vasil
Telerik team
 answered on 06 Apr 2011
5 answers
878 views
Hi,

I want particular index item values in radcombobox in client side. in code behind we have get easily like ddlCountyName.Items(1).Text but how to get the same in client side.

Please give me a tips for this one.


Thanks,
Dhamu.
Shinu
Top achievements
Rank 2
 answered on 06 Apr 2011
3 answers
217 views
Hello,

I am trying to use a custom radfilter datafield editor.  I am not binding the radfilter directly to anything.... i am merely using it to provide the user an interface to create an advanced grouped query - and then using it to get the strongly typed where condition.

the field I am having an issue with is technically a numerical field editor - although the fields they are referring to in the database are bit fields.

as a result, i am trying to only allow the user to choose between the values 0 and 1 through a dropdown box (with displayed values of "true" and "false" instead.

this seems to work.... once.  it will add the field editor once, but when i try to add another expression item, it runs into an error.

it looks like i am not passing on some editor variable from the base object... and possibly missing an override, but i am not sure.

the code for the editor is below:

public class RadFilterBooleanDropDownEditor : RadFilterDataFieldEditor
    {
        protected override void CopySettings(RadFilterDataFieldEditor baseEditor)
        {
            base.CopySettings(baseEditor);
            var editor = baseEditor as RadFilterBooleanDropDownEditor;
            if (editor != null)
            {
                //DataSourceID = editor.DataSourceID;
                //DataTextField = editor.DataTextField;
                //DataValueField = editor.DataValueField;
            }
 
        }
         
        public override System.Collections.ArrayList ExtractValues()
        {
            ArrayList list = new ArrayList();
            list.Add(int.Parse(_combo.SelectedValue));
            return list;
        }
 
        public override void InitializeEditor(System.Web.UI.Control container)
        {
            _combo = new RadComboBox();
            _combo.ID = "MyCombo";
            _combo.Width = System.Web.UI.WebControls.Unit.Pixel(48);
 
            _combo.Items.Add(new RadComboBoxItem("True","1"));
            _combo.Items.Add(new RadComboBoxItem("False","0"));
 
            //container.Controls[1].Visible = false;
 
            container.Controls.Add(_combo);
        }
 
 
        public override void SetEditorValues(System.Collections.ArrayList values)
        {
            if (values != null && values.Count > 0)
            {
                if (values[0] == null)
                    return;
                var item = _combo.FindItemByValue(values[0].ToString());
                if (item != null)
                    item.Selected = true;
            }
        }
 
        public string DataTextField
        {
            get
            {
                return (string)ViewState["DataTextField"] ?? string.Empty;
            }
            set
            {
                ViewState["DataTextField"] = value;
            }
        }
        public string DataValueField
        {
            get
            {
                return (string)ViewState["DataValueField"] ?? string.Empty;
            }
            set
            {
                ViewState["DataValueField"] = value;
            }
        }
        public string DataSourceID
        {
            get
            {
                return (string)ViewState["DataSourceID"] ?? string.Empty;
            }
            set
            {
                ViewState["DataSourceID"] = value;
            }
        }
 
        private RadComboBox _combo;
    }


and the error i get is as follows:

Object reference not set to an instance of an object.
 
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.NullReferenceException: Object reference not set to an instance of an object.
 
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:
 
 
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadFilterDataFieldEditor.CreateEditorFrom(RadFilterDataFieldEditor baseEditor) +9
   Telerik.Web.UI.RadFilterSingleExpressionItem.SetupFunctionInterface(Control container) +55
   Telerik.Web.UI.RadFilterExpressionItem.CreateFunctionalInterface() +89
   Telerik.Web.UI.RadFilterExpressionItem.InitializeItem() +24
   Telerik.Web.UI.RadFilter.CreateFilterItems() +284
   Telerik.Web.UI.RadFilter.CreateControlHierarchy() +34
   Telerik.Web.UI.RadFilter.CreateChildControls() +90
   System.Web.UI.Control.EnsureChildControls() +102
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +20
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +365
   System.Web.UI.Page.FindControl(String id) +38
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +287
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +878


any help with troubleshooting this issue would be MUCH appreciated.  thanks!
Mira
Telerik team
 answered on 06 Apr 2011
2 answers
108 views
Hi all,

I have a Radgrid with user defined edit control. I set the edit mode to popup. I have RadTextBoxes, RadDatePicker, RadListBoxes and RadAsyncUpload on it. I gave fixed width and height for the edit control. Everything works fine in FF, but I have few issues with the display in IE7.

These are the problems in IE7:
- On edit record pop up when scroll bars appear, listboxes appear outside the edit control popup. If i click on the listbox, it will arrange itself to correct postion. But when i scroll the scroll bar listbox won't scroll.
-When moving scroll bar on the edit control, the listboxes and async uploader don't scroll, as if they are positioned absolute/fixed, which I didn't do.
-Also, i have added header template to listbox and it is taking most of the height of the listbox height. so, i can't see the items in the list box.

I can send the code to reproduce it, if it helps. Any help is greatly appreciated.

Thanks,
CRS
Pavlina
Telerik team
 answered on 06 Apr 2011
3 answers
128 views
Hello All,

I'm new to Telerik controls. I'm sure this must be a simple one but wasn't able to figure out in the documentation. I would like to bind the combo box with the dataset I create dynamically instead of using SQL object datasource control.

Any help would be appreciated.

Thanks.
Shinu
Top achievements
Rank 2
 answered on 06 Apr 2011
1 answer
282 views
Hi,

We have a problem binding a Rad Grid with a SqlDataSource with a StoredProcedure. If we choose StoredProcedure on SqlDataSource always the Rad Grid appears with only a line of 1px.

If instead we choose select command and we put: "EXEC STORED" it works...

Can somebody help us?

Thanks!
Princy
Top achievements
Rank 2
 answered on 06 Apr 2011
1 answer
135 views
I am trying to do some client-side validation over 4 different tabs.  I can get the tabstrip and the tab elements just fine but when I try to find a specific control inside a given tab it is unable to find it.  Here is what I have.

var tabstrip = $find("<%=RadTabStrip1.ClientID %>");
var tab      = tabstrip.findTabByText("Statistics");
var amount   = tab.findControl("txt_amount");

"txt_amount" is the ID of a TextBox in a tab named "statistics."  Any suggestions would be greatly appreciated. 

Shinu
Top achievements
Rank 2
 answered on 06 Apr 2011
4 answers
1.0K+ views
Hi

I was quite surprised when using the RadTabStrip1.SelectedTab in a button click event in server side code to find that the value was null. I guess it makes sense as whatever tab a user clicks is all handled client side.
I decided to use the following code to find the selected tab server side. I've set the first tab selected by default.

Please can you tell me is this the correct way - or is there something easier?


<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" OnTabClick="RadTabStrip1_TabClick">
   <Tabs>
      <telerik:RadTab Text="Tab1" Selected="true"/>
      <telerik:RadTab Text="Tab2" />
      <telerik:RadTab Text="Tab2" />
   </Tabs>
</telerik:RadTabStrip>
 
<telerik:RadMultiPage ID="RadMultiPage1" runat="server">
   <telerik:RadPageView ID="RadPageView1" runat="server" Width="100%" Selected="true">xxx</telerik:RadPageView>
   <telerik:RadPageView ID="RadPageView2" runat="server" Width="100%">yyy</telerik:RadPageView>
   <telerik:RadPageView ID="RadPageView3" runat="server" Width="100%">zzz</telerik:RadPageView>
</telerik:RadMultiPage>

<asp:Button ID="btnOk" runat="server" Text="OK" onclick="btnOk_Click" />


The server-side code:
public string CurrentPageViewID
{
  get
  {
    if (ViewState["CurrentPageViewID"] != null)
      return (string)ViewState["CurrentPageViewID"];
    else
      return "RadPageView1";
  }
  set
  {
    ViewState["CurrentPageViewID"] = value;
  }
}
 
protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
{
  //update current tab
  CurrentPageViewID = e.Tab.PageView.ID;
}
 
protected void btnOk_Click(object sender, EventArgs e)
{
  Response.Write("Current Tab PageView ID is " + CurrentPageViewID);
}
Jeremy
Top achievements
Rank 1
 answered on 06 Apr 2011
1 answer
148 views
I have read multiple articles on compiling a Web User Control into an assembly to be used by other applications.  I have done this part and it works fine using the Web Deployment Project add-in. 

When this assembly containing the web user controls are included in a web project,  they do not show up in the Toolbox of visual studio.  I understand that this is probably an issue of them being  System.Web.UI.UserControl.  However, I am placing the question here, How can I get this control to show up in the Toolbox? 

Since Telerik builds server control suites and the developers here are quite good, someone has got to know what class, interface, attributes, will turn this functionality on.  I tried the ToolboxData attribute, but  that doesn't change anything.  I have gone through the Apress server controls pro dev books and scourered online.  Help anyone?
Andrew Chandler
Top achievements
Rank 2
 answered on 06 Apr 2011
3 answers
92 views
I have a radgrid control which is bound to some data.
One of the columns is an image that I'd like to be excluded from my export button.
How can this be done?

Thanks
Daniel
Telerik team
 answered on 05 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?