Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
105 views
I have a class that I use to supply the image URL for toolbars. The values are held in an XML file.

I can use this quite successfully to set the ImageUrl of the various buttons in the page's code-behind.

I'd like to be able to use the same idea for populating this property in the markup.

I thought to just write something like this ...
<telerik:RadToolBarButton Value="Add" ImageUrl='<%= IconManager.GetButton("Add") %>' />
But, it seems, you can't do that.

Is there a way around this or a way to achieve the same result?

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 20 Nov 2010
1 answer
50 views

Hello,
I have one ajaxified radgrid which is getting ajaxified through RadAjaxManager.Outside the grid I have two asp buttons.On pageload I am adding ajaxsettings for those buttons.On grid inline edit I am trying to disable those buttons.Those buttons are getting disabled.But I am getting null object exception on clicking the button.If I remove the ajaxsettings from pageload everything works fine but the buttons are not getting disabled.Please suggest me at your earliest...Below are the code in page_load.



 

protected void Page_Load(object sender, EventArgs e)

 

{

 

  RadAjaxMgriPur.AjaxSettings.AddAjaxSetting(RGridImportedData, btnCreateOrder,

 

null);

 

 

 

 

  RadAjaxMgriPur.AjaxSettings.AddAjaxSetting(btnCreateOrder, RGridImportedData, RadAjaxLoadingPaneliPur);

 

 

}


 

 

 

protected void btnCreateOrder_Click(object sender, EventArgs e)

 

{
     //some operations....
   

 

RGridImportedData.Rebind();

 

 

 

 

}

Thanks in advance.

Manaswinee

  
Shinu
Top achievements
Rank 2
 answered on 20 Nov 2010
1 answer
89 views
My datasource for my radcombobox has extra fields in it.  The datasource has fields for PeriodName, PeriodStartDate and PeriodEndDate.  The text in the combo is the PeriodName field.  What I would like is when the user selects a period name and the form postbacks, to have a label above the combobox and have it say something like "For the Period 1/2/1010 to 1/31/2010'.  How would I go about doing something like this?  Thanks.
Shinu
Top achievements
Rank 2
 answered on 20 Nov 2010
3 answers
101 views
Hello,

I'm triying to implement a filter control besides a rad grid control. However i have had some problems with its visualization. I have followed the recommendations about the controls nevertheless the filter control doesn't display. I have reviewed the filter code and the datasource as well.
Any Suggestion??
<telerik:RadAjaxManager id="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="grid" >
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grid" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
 
 <telerik:RadGrid  runat="server" ID="grid" AutoGenerateColumns="False"
    AllowPaging="True" OnNeedDataSource="grid_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand"
    OnInsertCommand="RadGrid1_InsertCommand"  OnItemCommand="RadGrid1_ItemCommand"
    onpageindexchanged="grid_PageIndexChanged"  OnItemDataBound="RadGrid1_ItemDataBound" FilterItemStyle-Wrap="true"
                    Culture="es-CO" GridLines="None"   >
    <MasterTableView DataKeyNames="" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="EditForms">
        <Columns>   
     <telerik:GridBoundColumn UniqueName="id" DataField="id" HeaderText="Id" 
            ForceExtractValue="InEditMode" ConvertEmptyStringToNull="true" Visible="false" >
      </telerik:GridBoundColumn>
      <telerik:GridTemplateColumn  UniqueName="Sociedad" DataField="Sociedad" HeaderText="Sociedad"
             ForceExtractValue="InEditMode" ConvertEmptyStringToNull="true"  >              
              <EditItemTemplate>   
                        <asp:DropDownList CssClass="dropdownlist" ID="ddlContainerSociedad" runat="server"></asp:DropDownList
                         <asp:Label ID="LabelCompanyID" runat="server" Text='<%#Eval("CompanyID") %>'></asp:Label>                   
                    </EditItemTemplate>
                        <ItemTemplate>
                        <asp:Label ID="LabelCompanyID" runat="server" Text='<%#Eval("CompanyID") %>'></asp:Label>
                    </ItemTemplate>
                     <FilterTemplate>
                <telerik:RadComboBox ID="cbFSociedad" runat="server" DataSourceID="SqlDataSource1"
                    DataTextField="CompanyID" DataValueField="CompanyID" AppendDataBoundItems="true"
                    SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Sociedad").CurrentFilterValue %>'
                    OnClientSelectedIndexChanged="TitleIndexChanged" >
                    <Items>
                        <telerik:RadComboBoxItem Text="Todas" />
                    </Items>
                </telerik:RadComboBox>
                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                    <script type="text/javascript">
                        function TitleIndexChanged(sender, args) {
                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                            tableView.filter("Sociedad", args.get_item().get_value(), "Contains");
                        }
                    </script>
                </telerik:RadScriptBlock>
            </FilterTemplate>
                               
             </telerik:GridTemplateColumn>
 
       <telerik:GridEditCommandColumn ButtonType="ImageButton" />          
        </Columns>   
    </MasterTableView>
    <PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PanalpinaEntities %>" 
            SelectCommand="SELECT distinct
      [CompanyID]     
  FROM [Panalpina].[dbo].[SAPCenterCostBranch]
order by [CompanyID]      " ProviderName="System.Data.SqlClient">
        </asp:SqlDataSource>


Best Wishes,
William
william
Top achievements
Rank 1
 answered on 19 Nov 2010
1 answer
83 views
Hi all,
I need help on following.

I am getting Html content from SQL database, then attaching some data to it and then rendering it on a <asp:lable.. server control.
I want my users to be able to export the rendered content to a PDF file.

1.  Which Telerik control will best suit for this need? (i.e. Does telerik have a control which I can use it in place of <asp:Lable that supports export to PDF)
2.  If not, is there any other way to do it?

We have telerik. I don't want to use any other 3rd party components.

Thanks in advance
Piyush
Daniel
Telerik team
 answered on 19 Nov 2010
4 answers
158 views
Great job Telerik on RadListBox.  We have a couple homegrown alternatives to this and have been hoping you would release this type of control so we could standardize.

One of our current projects relies on multiple combinations of controls created in runtime, after init.  To view these object and their values on postback, we are taking advantage of request.form in the postback and parsing the results.

 Dim str As String 
 Dim str2 As String = "" 
For Each str In Request.Form 
   str2 += str & "  -  " & Request.Form(str) & "<br>"    
Next 
 
Response.Write(str2) 


RadListbox gives us a method of tracing the users actions click by click, but it would be great if the postback could include either the text, or preferably the value, of the RadListboxItem along with the ordinal position changes.  We frequently need to randomize the position of the listitems in these situations to prevent bias so we will currently need to store additional data in hidden controls for the ordinal mapping.  I realize this is not standard usage of the control, but if you could add for future consideration either an ordered list of all values within Radlistbox in request.form (preferable), or include the value in the ordinal move data as it is now, it would streamline the process significantly.

The example beliw is the output of a 4 item list where the last item (3) is placed in position 0 recursively until the list is in it's original position again.

QUIHereType_ClientState - {"logEntries":[{"Type":5,"Index":"3","Data":{"NewIndex":"0"}},{"Type":5,"Index":"3","Data":{"NewIndex":"0"}},{"Type":5,"Index":"3","Data":{"NewIndex":"0"}},{"Type":5,"Index":"3","Data":{"NewIndex":"0"}}],"selectedIndices":[0],"checkedIndices":[],"scrollPosition":0} 



Thanks again for your excellent work with this release.

-Joel

[edit]  subject line should not have included the word viewstate...

Todd
Top achievements
Rank 2
 answered on 19 Nov 2010
3 answers
129 views
Hi,

I've got a really simple situation here that is malfunctioning for some reason..
I've got a RadDatePicker :

<telerik:RadDatePicker ID="datePicker" runat="server" (...) />

And some simple javascript that is running when I press a button:

var datePickerElem = $('#<%= datePicker.ClientID %>').get(0);
var currDate = datePickerElem.get_selectedDate();

The object is found properly, but I get the exception "Microsoft JScript runtime error: Object doesn't support this property or method" when calling get_selectedDate(). Any idea of what's wrong?

BR
Daniel
Telerik team
 answered on 19 Nov 2010
4 answers
206 views
I have a need to either change the forecolor or the backcolor of certain items within a combo box dropdown list. Some may need both applied. I have a default backcolor to white and a default forecolor to black. The dropdown is a list of bills. If one bill contains hazardous cargo then i want the bill number to be red instead of black letters. If the bill is no longer an active bill then i want the change the backcolor of the item to be pink instead of white. If it is an inactive hazardous bill then i want red letters and a pink background to both apply. Changing the forecolor to red is working. Changing the backcolor is not working. The backcolor ends up visually not applying to the proper row. I am setting this within the ItemsRequested event with the code below within the loop that adds the data and binds it to the combo. (attached is a sceenshot of the results, each row where the column == N then the backcolor should be pink)

 

 

string mystatus;

 

mystatus = lBooking.STATUS;

item.Attributes.Add(

 

"STATUS", mystatus);

 

 

 

string myhaz;

 

myhaz = lBooking.HazFlag;

item.Attributes.Add(

 

"HazFlag", myhaz);

 

rcboBookingNum.Items.Add(item);

 

 

if (myhaz=="Y")

 

{

rcboBookingNum.Items[myitemcounter].ForeColor = System.Drawing.

 

Color.Red;

 

}

 

 

if (mystatus == "N")

 

{

rcboBookingNum.Items[myitemcounter].BackColor = System.Drawing.

 

Color.Pink;

 

}

myitemcounter = myitemcounter + 1;




XAML CODE :


 

 

<telerik:RadComboBox ID="rcboBookingNum" runat="server" OnItemsRequested="rcboBookingNum_ItemsRequested"

 

 

 

EnableLoadOnDemand="True" AllowCustomText="True" DropDownWidth="555px" AutoPostBack="True"

 

 

 

OnSelectedIndexChanged="rcboBookingNum_SelectedIndexChanged" ShowDropDownOnTextboxClick="False"

 

 

 

OnClientKeyPressing="OnClientKeyPressingrcboBookingNum"

 

 

 

MaxHeight="150"

 

 

 

Width="120px" Skin="Outlook" HighlightTemplatedItems="false" EnableTheming="False"

 

 

 

CssClass="MainPageCellInputs ForceCaps"

 

 

 

MaxLength="13" TabIndex="1"

 

 

 

MarkFirstMatch="True">

 

 

 

<CollapseAnimation Type="None" />

 

 

 

<HeaderTemplate>

 

 

 

<table width="530px" class="rcbo_tbl10" align="left">

 

 

 

<tr>

 

 

 

<td style="width: 100px" class="dd_col10 dd_head10">

 

Booking Num

 

 

</td>

 

 

 

<td style="width: 230px" class="dd_col10 dd_head10">

 

Ship Name

 

 

</td>

 

 

 

<td style="width: 80px;text-align:center;" class="dd_col10 dd_head10">

 

Status

 

 

</td>

 

 

 

<td style="width: 80px;text-align:center;" class="dd_col10 dd_head10">

 

Hazardous

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</HeaderTemplate>

 

 

 

<ItemTemplate>

 

 

 

<table width="530px" class="rcbo_tbl10" align="left">

 

 

 

<tr>

 

 

 

<td style="width: 100px" class="dd_col10">

 

<%

 

# DataBinder.Eval(Container, "Text")%>

 

 

 

</td>

 

 

 

<td style="width: 230px" class="dd_col10">

 

<%

 

# DataBinder.Eval(Container, "Attributes['ShipName']") %>

 

 

 

</td>

 

 

 

<td style="width: 80px;text-align:center;" class="dd_col10">

 

<%

 

# DataBinder.Eval(Container, "Attributes['STATUS']")%>

 

 

 

</td>

 

 

 

<td style="width: 80px;text-align:center;" class="dd_col10">

 

<%

 

# DataBinder.Eval(Container, "Attributes['HazFlag']")%>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</ItemTemplate>

 

 

 

</telerik:RadComboBox>

 


Scott Nolen
Top achievements
Rank 1
 answered on 19 Nov 2010
4 answers
171 views
<script type="text/javascript"
function setReadOnly() 
    var TextBox1 = $find("<%= RadTextBox1.ClientID %>"); 
    TextBox1._textBoxElement.readOnly = state
function clearReadOnly() 
    var TextBox1 = $find("<%= RadTextBox1.ClientID %>"); 
    TextBox1._textBoxElement.readOnly = false
 
</script>

Using the above to toggle a textbox readonly flag. Setting back readonly = false and then entering a value into the textbox, upon postback the value is empty.

Question : How to toggle readonly flag client side and make control behave correctly upon postback?

*** Note: Here is the strange part, the control only fails (empty string) on the first postback - after that things work correctly.

More Info: On the first postback - the ReadOnly flag on the server side is false. So setting readonly  to false in java-script did not update something and serverside the flag is still true. I think that why the value is empty.
MarkInTexas
Top achievements
Rank 1
 answered on 19 Nov 2010
6 answers
547 views
hi my dear experts :
i want to show a message in the textbox of RadComboBox When It's Load Like plz Choose an item.
i mean i do not want to have an item with this message as text and i want show the message at radcombobox load.
for this porpose radcombobox shouldn't put the first item as a selected item...
empty message property works when we make an empty item in radcombo box but i don't want an empty item in my list items and do n't let my user to choose an empty item...
Jeremy
Top achievements
Rank 1
 answered on 19 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?