Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
I have a RadComboBox setup to display Checkboxes, like this:

					<telerik:RadComboBox ID="cmbLocation" Name="Location" runat="server" DataTextField="Key" DataValueField="Value" TabIndex="18" Width="214"
OnClientDropDownClosing="OnClientDropDownClosing" MarkFirstMatch="true" AllowCustomText="false">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkLocation" Text='<%# Eval("Key")%>'/> 
</ItemTemplate>                    
</telerik:RadComboBox>
The ComboBox is then simply bound to a List<KeyValuePair<string,int>> datasource in code behind.

I need to add an item to the top of the list that simply says "ALL". I really don't need a Checkbox in this item, for what it is worth.

I am currently doing this:
            cmbLocation.Items.Insert(0, new RadComboBoxItem(Common.All, "-1"));
This works more or less. When I run the app, the ComboBox reads "All". But there is also a blank checkbox in the first position. I don't want that to be there. But I do need to be able to tell if All is selected.

WHen I look in the generated HTML code, I see that the first item is only an <input> (type of checkbox). All the rest of the items have both a <label> and an <input>.

What's the right way to add a default item here?
Shinu
Top achievements
Rank 2
 answered on 19 Jan 2011
3 answers
150 views

java script error is coming when we are using Telerik Calendar control in a page, and if we use SetFocusOnError="true"

Property.
Moreover we have used the ajax validator extender.
Please refer attachment.
can anyone have idea about any possible solutions?

 

Pavel
Telerik team
 answered on 19 Jan 2011
1 answer
102 views
I need to create a grid that acts like the ms excel. basically the user wants to select several rows from an excel sheet and past on on a radgrid. and when a button is clicked, the code will save those information in the db.  any help will be appreciated.
Shinu
Top achievements
Rank 2
 answered on 19 Jan 2011
1 answer
419 views
Hi all.

I am having problem in rad grid export.When i export the radgrid with ignore paging to word ,excel or pdf alll record gets exported this is finr.But now when i change the page or move to other page than 1 and export grid with ignor paging it give me file with no record to display.

my button code is as follows

   protected void uxBtnWord_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                if (uxRadGrid.Items.Count == 0) return;
                if (uxIgnorePaging.Checked)
                  // uxRadGrid.PageSize = uxRadGrid.MasterTableView.VirtualItemCount;
                uxRadGrid.ExportSettings.IgnorePaging = uxIgnorePaging.Checked;
               
                uxRadGrid.ExportSettings.OpenInNewWindow = true;
                uxRadGrid.ExportSettings.ExportOnlyData = true;
                isExport = true;
            
                uxRadGrid.MasterTableView.ExportToWord();
            
                
            }
            catch (Exception ex)
            {
             
            }
        }

please help it out
Daniel
Telerik team
 answered on 19 Jan 2011
2 answers
64 views
Hi all,
Please advise.
After selected 1stCombo, then bind 2ndCombo base on 1stCombo selected value & text.
Thant's why I need to send both selectedText & Value from ClientScript at ClientSelectedIndexChange.

My code is as below
<telerik:RadComboBox ID="Cbo1" runat="server"
        CssClass="label" Label="Combox1     :" Skin="WebBlue"
        OnClientSelectedIndexChanging="LoadCbo2l"
            OnItemsRequested="Cbo1_ItemsRequested"
            onclientitemsrequested="ItemsLoaded" ViewStateMode="Enabled"
                ></telerik:RadComboBox>
 
<telerik:RadComboBox ID="Cbo2" Runat="server" CssClass="label" Label= "Combox2 :"
            Skin="WebBlue" OnItemsRequested="Cbo2_ItemsRequested"
            OnClientItemsRequested="ItemsLoaded" ViewStateMode="Enabled">
        </telerik:RadComboBox>
 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
     <script type="text/javascript">
 
function LoadCbo2(combo, eventArqs) {
    var 2ndCombo;
             var item = eventArqs.get_item();
             2ndCombo.set_text("Loading...");
  
             if (item.get_index() > 0) {
                      Cbo2.requestItems(item.get_value(), false);
             }
             else {
                 2ndCombo.set_text(" ");
                 2ndCombo.clearItems();
             }
         }
        </script>
</telerik:RadCodeBlock>

With this I only get selected value at Cbo2_ItemsRequested event, when I try to get with  Cbo1.SelectedItem.Text  directly, the text I selected is not yet there.
How can I get both, please?

Thanks and best regards
Naunton
Top achievements
Rank 1
 answered on 19 Jan 2011
1 answer
192 views
I can't find ASP.NET Checkbox in Radgrid row with Client side Javascript in the RowDatabound event.  I would think this would be simple to do. I must be doing something silly.

I am able to find a Telerik control but not a ASP.NET control
       function RadGrid1_RowDataBound(sender, args) {
  
  
          // this works
           var radTextBox1 = args.get_item().findControl("LastName"); // find control
           radTextBox1.set_value(args.get_dataItem()["Enabled2"]);
  
           // This does not work
           var MyCheckbox = args.get_item().findControl("CheckBoxEnabled"); // find control
}

Here is the grid code

<telerik:GridTemplateColumn HeaderText="Enabled" AllowFiltering="False">
    <HeaderStyle Width="40px" />
    <ItemStyle Width="40px" />
    <ItemTemplate>
        <!-- Can find this -->
        <telerik:RadTextBox ID="LastName" runat="server" Width="80px" />
         <!-- Cannot find this -->
        <asp:CheckBox ID="CheckBoxEnabled" runat="server" />
    </ItemTemplate>
</telerik:GridTemplateColumn>


Thanks

 

 

 

Shinu
Top achievements
Rank 2
 answered on 19 Jan 2011
1 answer
62 views
Hi,

I want to add row
 
header and column header on grid. Please let me know what is the better way

 column

Base Currency

SGD

THB

USD

 

 

BHD

 

 

HKD

 

 

 

 

 

 

 

 


Column types demo table no  border

Shinu
Top achievements
Rank 2
 answered on 19 Jan 2011
1 answer
108 views
Hi.

Is there a way to make a custom command show a context menu?
Just as if the command icon was the root level of a dropdown menu.

Thank you
/Jesper
Jesper Krejberg Petersen
Top achievements
Rank 2
 answered on 18 Jan 2011
4 answers
189 views
Telerik.Web.UI : runtime = v2.0.50727, ver = 2008.2.723.20

Error when removing column from grid.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
 

Process I am going through:

1. user selects add column on the page
2. Post back, add column to datasource
3. rebind grid
    (grab data from datasource, clear columns from grid, add all current columns)
4. user selects delete column
5. confirm delete
6. postback, delete column from datasource
7. rebind grid
    (grab data from datasource, clear columns from grid, add all current columns)

This works if all of this is done continuously. However, if I navigate off of this page at before step 4 and return to the page and continue, then I receive the error above.

Note: on NeedDataSource event I am setting datagrid.DataSource to the System.Data.DataTable

i dont know if it has to do with the viewstate? i tried to provide as much info as i can, let me know if anything else is required.

------------------------------

[External Code]
  System.Web.RegularExpressions.dll!System.Web.Util.CalliHelper.EventArgFunctionCaller(System.IntPtr fp, object o, object t, System.EventArgs e) + 0x10 bytes 
  System.Web.dll!System.Web.Util.CalliEventHandlerDelegateProxy.Callback(object sender, System.EventArgs e) + 0x22 bytes 
  System.Web.dll!System.Web.UI.Control.OnLoad(System.EventArgs e) + 0x64 bytes 
  System.Web.dll!System.Web.UI.Control.LoadRecursive() + 0x30 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint = true) + 0x59d bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint = true) + 0x67 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x57 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext context) + 0x13 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0x32 bytes 
  App_Web_3crb2jk7.dll!ASP.error_error_aspx.ProcessRequest(System.Web.HttpContext context = {System.Web.HttpContext}) + 0x2f bytes C#
  System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x167 bytes 
  System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, ref bool completedSynchronously = true) + 0x41 bytes 
  System.Web.dll!System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(System.Exception error) + 0x1b3 bytes 
  System.Web.dll!System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) + 0x8e bytes 
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest wr = {Microsoft.VisualStudio.WebHost.Request}) + 0x1b5 bytes 
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest wr) + 0x62 bytes 
  System.Web.dll!System.Web.HttpRuntime.ProcessRequest(System.Web.HttpWorkerRequest wr) + 0x38 bytes 
  WebDev.WebHost.dll!Microsoft.VisualStudio.WebHost.Request.Process() + 0x113 bytes 
  WebDev.WebHost.dll!Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Microsoft.VisualStudio.WebHost.Connection conn = {System.Runtime.Remoting.Proxies.__TransparentProxy}) + 0x5c bytes 
  [Appdomain Transition] 
  WebDev.WebHost.dll!Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(object acceptedSocket) + 0x86 bytes 
  mscorlib.dll!System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(object state) + 0x1a bytes 
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x81 bytes 
  mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback tpWaitCallBack) + 0x50 bytes 
 mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(object state) + 0x60 bytes 


Srinivas
Top achievements
Rank 1
 answered on 18 Jan 2011
6 answers
256 views
Hello everybody.
I can't succed in find anything with $find('objectID') method.
I'm using a webapp structure consisting of one page that loads dynamically a couple of UserControls implementing various functions.
On the other hand document.getElementById('objectID') give me back the object, so I'm pretty sure the objectID is correct.
Any idea?

Thanks in advance

Andrea

Adham Shaaban
Top achievements
Rank 1
 answered on 18 Jan 2011
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?