Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
198 views
I came across the following http://www.telerik.com/help/aspnet-ajax/ajxclientsideperformance.html saying I could update a containing table or div rather than individual controls, and thought I would use this as I have a table containing about 20 controls that all need updating, so changed RadAjaxManager from updating each individual control to update either the table or the containing div, but neither seems to update the controls within the table.

Is this meant to be OK?

David Penny
David Penny
Top achievements
Rank 2
 answered on 08 Feb 2010
1 answer
114 views
Hi,
I need to detect when spellchecker modified the texts in the textbox so I can raise the isDirty flag.
I tried implementing my own isDirty flagging by comparing value of the textbox with original texts when OnClientCheckFinished is called, but the problem is OnClientCheckFinished is called before any of the textbox has actually been modified. Is there any other solution to this that might work?
Thanks!
Kate
Rumen
Telerik team
 answered on 08 Feb 2010
1 answer
93 views
Hi,

In the Radgrid, if I try to filter by a date column between two times it doesn't work. Basically I want to see all the records between "01/10/2010 12:00:00" to "11/10/2010 12:00:00". I would like to see this by entering the text  - "01/10/2010 12:00:00 11/10/2010 12:00:00" in the Filter Textbox and selecting "Between"  Filter Menu option on a DateTime column.

But I don't get the desired result. Infact as soon as radGrid encounters more than one space between a string it empties that string and makes CurrentFilterValue for that columns as a empty string. Can I make RadGrid not do so?

Filtering options that works on Radgrid are as follows:
- "01/10/2010 12:00:00" -> EqualTo, Greater Thans, etc.
- "01/10/2010" -> EqualTo, Greater Thans, etc.
- "01/10/2010 11/10/2010" -> Between.

Filtering options that DO NOT work on Radgrid are as follows:
- "01/10/2010 12:00:00 11/10/2010 16:30:00" -> Between. - I WANT THIS  TO WORK

I am override the RaisePostBackEvent, but the filter value in the above case is emptied out. 

Any help?

Thanks
Pavlina
Telerik team
 answered on 08 Feb 2010
1 answer
149 views
Dim rs As SqlDataReader = something 
Dim dt As New DataTable 
 dt.Load(rs) 
RadTreeView1.DataSource = dt 
RadTreeView1.DataTextField = dt.Columns("descriptions").ToString 
RadTreeView1.DataValueField = dt.Columns("sections").ToString 
RadTreeView1.DataBind() 
 
RadTreeView1.SelectedNode.Value = "somthing" always tells me that object reference is nothing can you tell me why or how do i set it to select the first value in the tree view. also if the first node in treeview is expandable, how do i expand it and then select the first child node in that parent node. thank you 
 
RadTreeView1.SelectedNode.Value = "somthing" always tells me that object reference is nothing can you tell me why or how do i set it to select
 the first value in the tree view. also if the first node in treeview is expandable, how do i expand it and then select the first child node in that parent node. thank you 
Schlurk
Top achievements
Rank 2
 answered on 08 Feb 2010
4 answers
173 views
Hi,

I am using a color picker for an ecommerce site.  I am using it as a color swatch for the user to select the color of shirt they want.  Everything is working as expected with one exception.  I need to find a way to add another argument to the ColorPickerItem in addition to the value and title.

The logic works like this.  The admin adds an attribute such as 'color' to the product.  The attribute is assigned a control (ColorPicker). The admin then adds values to the control (Red, Blue, White, etc.).  The ecommerce site logic usually works with a dropdown control which also has only 2 arguments (value, text).  The value is the database value of the 'attribute-value' (Red-id, Blue-id, etc.).  How can I add another argument to RadColorPicker such as RadColorPicker(int Id, Color value, String title).  

Here is some code:  Hope this makes sense.

///***Add ColorSwatch Control 
                            case AttributeControlTypeEnum.ColorSwatch: 
                                { 
                                    ///***Define RadColorPicker Attributes 
                                    RadColorPicker rcpColorSwatch = new RadColorPicker(); 
                                    rcpColorSwatch.ID = attribute.ProductAttribute.Name; 
                                    rcpColorSwatch.Preset = ColorPreset.None; 
                                    rcpColorSwatch.ShowEmptyColor = false
                                    rcpColorSwatch.PreviewColor = false
                                    ///***Add Attribute Collection Values to ColorPickerItemCollection 
                                    ProductVariantAttributeValueCollection pvaValues = attribute.ProductVariantAttributeValues; 
                                    foreach (ProductVariantAttributeValue pvaValue in pvaValues) 
                                    { 
                                        string pvaValuepvaValueName = pvaValue.Name; 
                                        decimal priceAdjustmentBase = TaxManager.GetPrice(productVariant, pvaValue.PriceAdjustment); 
                                        decimal priceAdjustment = CurrencyManager.ConvertCurrency(priceAdjustmentBase, CurrencyManager.PrimaryStoreCurrency, NopContext.Current.WorkingCurrency); 
                                        if (priceAdjustmentBase > decimal.Zero) 
                                            pvaValueName += string.Format(" [+{0}]", PriceHelper.FormatPrice(priceAdjustment, false, false)); 
                                        ColorPickerItem cpiValueItem = new ColorPickerItem((ColorTranslator.FromHtml(pvaValue.ProductVariantAttributeValueID.ToString())), (pvaValueName)); 
                                        rcpColorSwatch.Items.Add(cpiValueItem);                                          ///Above-This is the ValueId of color.  I need this plus the color value
                                    } 
                                    divAttribute.Controls.Add(rcpColorSwatch); 
                                } 
                                break; 
  
Joe
Top achievements
Rank 1
 answered on 08 Feb 2010
2 answers
126 views
I been trying to clear the filter through code behind methods.

I set each columns to

column.CurrentFilterFunction =

GridKnownFunction.NoFilter;

Then I rebind the grid

The grid then refreshes but all the records are missing.  I would have expected the grid to show all records...

So how do I programatically clear the filter in code behind c# and have the grids show all records.


I am just frustrated I missed something and google this time has failed me.

Thanks in advance

Stephen Altemus

Tsvetoslav
Telerik team
 answered on 08 Feb 2010
3 answers
138 views
hi all,

i have a custom validator for a RadUpload control in the grid. i want the validator to validate empty text only on insert not on update, on update it's not required to upload a file but if the user selected one it should get validated.

i have put this code in ItemDataBound
    Private Sub RadGrid1_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound  
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then 
            Dim item As GridEditableItem = CType(e.Item, GridEditableItem)  
            Dim imageValidator As CustomValidator = CType(item.FindControl("CustomValidator2"), CustomValidator)  
            If (item.OwnerTableView.IsItemInserted) Then 
                imageValidator.ValidateEmptyText = True 
            Else 
                imageValidator.ValidateEmptyText = False 
            End If 
        End If 
    End Sub 

but it didn't work bcoz the ClientValidationFunction still validating empty text in both cases. So i tried to modify this function to check if the item is in edit or insert mode using get_isItemInserted, but sth is wrong and i coudn't fix it. Here is my code
function validateImageType(source, e)   
{  
    e.IsValid=false;  
 
    var upload=$find(source.parentNode.getElementsByTagName('div')[0].id);            
    var inputs=upload.getFileInputs();  
      
    if (e.get_isItemInserted==true)  
    {  
        for (var i = 0; i < inputs.length; i++)   
        {  
            //check for empty string or invalid extension  
            if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value))   
            {  
                e.IsValid=true;  
                break;  
            }  
        }              
    }              
    else 
    {  
        if (inputs.length>0)  
        {  
            for (var i = 0; i < inputs.length; i++)   
            {  
                //check for invalid extension only  
                if (upload.isExtensionValid(inputs[i].value))   
                {  
                    e.IsValid=true;  
                    break;  
                }  
            }                    
        }  
        else 
        {  
            e.IsValid=true;  
        }  
    }  
}       

And here is my column if nedded
            <telerik:GridTemplateColumn HeaderText="Image" SortExpression="image" UniqueName="image" AutoPostBackOnFilter="true" DataField="image">  
                <ItemTemplate> 
                    <img src='/Files/PhotoGallery/<%# Eval("image") %>' width="100" height="100" /> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <telerik:RadUpload ID="RadUpload1" runat="server" AllowedFileExtensions=".jpg,.jpeg" ControlObjectsVisibility="None"></telerik:RadUpload> 
                    <asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="Allowed file extensions are .jpg, .jpeg" ClientValidationFunction="validateImageType" Display="Dynamic"></asp:CustomValidator> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn>     

Any ideas plzzz..??

thnx in advance
FreshOne
Top achievements
Rank 1
 answered on 08 Feb 2010
1 answer
86 views
I fill my Grid in my code behind but when the page posts back my grid desapears....

Is the same site I'm building here:

Gilberto Anino
Top achievements
Rank 1
 answered on 08 Feb 2010
2 answers
290 views

I have a repeater that contains a Telerik RadComboBox:

<asp:Repeater ID="rpt" runat="server">
   
<ItemTemplate>
       
<telerik:RadComboBox ID="rcb" runat="server" EnableLoadOnDemand="true"  
             
AllowCustomText="true" ItemRequestTimeout="1000"
             
NumberOfItems="10" MarkFirstMatch="false">
       
</telerik:RadComboBox>
   
</ItemTemplate>
</asp:Repeater>

In the ItemDataBound event of the Repeater, I am wiring up the ItemsRequested event like this:

private void rpt_ItemDataBound(object sender, RepeaterItemEventArgs e) {
   
RadComboBox rcb = (RadComboBox)e.Item.FindControl("rcb");
    rcb
.ItemsRequested += rcb_ItemsRequested;
}
private void rcb_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) {
   
// Database call to load items occurs here.
   
// As configured, this method is never called.
}

Currently, the server-side rcb_ItemsRequested method is never called. I suspect that wiring the ItemsRequested event in the ItemDataBound is problematic, but the problem may lie elsewhere.

Any ideas on how to use the Telerik RadComboBox within a repeater properly? I also tried wiring the event in the markup, but that did not help either. I am using the latest version of the ASP.NET AJAX Rad Controls.

----------

I posted this question at stackoverflow:

http://stackoverflow.com/questions/2209503/using-telerik-radcombobox-within-a-repeater

Lenny_shp
Top achievements
Rank 2
 answered on 08 Feb 2010
6 answers
258 views
Hello,

Before I purchase the controls, I make a small check if they support right to left.

I'm having a problem with RadGrid, in my MasterPage I must define the body direction to "RTL":
<body Direction="rtl">

Then i define in my grid  <MasterTableView Dir="RTL">, as a result the filter window is open all over the page width.


Is there a solution to the problem?

Thanks in advance

Avner
Dimo
Telerik team
 answered on 08 Feb 2010
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?