Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
339 views
I am using a RadGrid and sorting is not working.  As an experiment I removed my grid and replaced with the grid from the
"Grid - Advanced Data Binding" demo. http://demos.telerik.com/aspnet-ajax/grid/examples/programming/needdatasource/defaultvb.aspx?#qsf-demo-source 

I linked to my data: RadGrid1.DataSource = GetSearchData() and the grid appeared displaying my data but sorting does not work.

When I click to sort,
        Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
            RadGrid1.DataSource = GetSearchData()
        End Sub

is called.  The data is returned but it is not sorted,

Any idea how I can get sorting to work?
David
Top achievements
Rank 1
 answered on 26 Mar 2013
10 answers
479 views
I want to use the Vista skin but override the chart background to white. Is this not possible without having to make my own skin? The following is not working for me:

<telerik:RadChart ID="chart" Skin="Vista" runat="server"> 
    <Appearance> 
        <Border Visible="false" /> 
        <FillStyle FillType="Solid" MainColor="White" /> 
    </Appearance> 
</telerik:RadChart> 

Thank you


Ab
Top achievements
Rank 1
 answered on 26 Mar 2013
1 answer
117 views
Hi,
I am using text wrap on the columns of the radgrid but when the text wraps, instead of moving complete words to the next line, it moves the words partially. Attached jpg file will show you the issue.
Any pointers on what am I missing here?

Thanks!
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Mar 2013
2 answers
207 views
Hi
Need some guidance in Multirow Multicolumn combobox as the second combobox in the demo 
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multicolumncombo/defaultvb.aspx 

 (Image attached - want it without pictures though) to select individual cells. Studied the example but could not figure out how it was made, there is not much in the demo files about RadCombobox2

Any help is much appreciated.
thanks
Hamid

Hamid
Top achievements
Rank 1
 answered on 26 Mar 2013
4 answers
87 views
My apologies if this is somewhat similar to a problem I've posted earlier.  However this is a much simpler example.  (No RadGrid involved.)

I have a page on which I have (or rather had) 3 RadCombo boxes.  The 3 boxes (and their validators) are enclosed in a RadAjax panel.   The basic idea was that the 1st radcombo box would do a postback when it was changed and the values of the other two dropdowns would be updated accordingly.  The other 2 boxes have their AutoPostBack = false.

I could not get this to work.  The problem was that whenever I changed the 1st combo box, the custom validators of the other two would fire and prevent the update code from being called on the server side.  The custom validators call conventional JavaScript functions, much like all the others I use in this application.

My fix was similar to an earlier problem.  I changed the 1st combo box to a conventional asp:Dropdown list and everything works perfectly.  No other changes needed.

What, if anything, am I doing wrong?

My current Telerik.Web.UI is version 2012.2.607.40.  (I know.  Once again I'll try to get an upgrade if that is actually the problem.)

Boris
Top achievements
Rank 1
 answered on 26 Mar 2013
1 answer
562 views
I have a column defined as:
<telerik:GridCheckBoxColumn ConvertEmptyStringToNull="False"
    FilterControlAltText="Filter checked column" SortExpression="Checked"
    UniqueName="Checked" DataField="Checked" HeaderText="Remove" ToolTip="Check this box to remove this item from your cart" DataType="System.Boolean">
    <HeaderStyle Wrap="False" HorizontalAlign="Left" Width="80px" CssClass="grid-header grid-header-first" />
    <ItemStyle HorizontalAlign="Center" Width="100%" VerticalAlign="Top" />
</telerik:GridCheckBoxColumn>

This column is the only edit-able field in the grid, the rest are bound columns marked as ReadOnly.  The grid always has all rows in edit mode using the following:
protected void grdItems_PreRender(object sender, EventArgs e)
{
    try
    {
        foreach (GridDataItem colGridField in grdItems.MasterTableView.Items)
            colGridField.Edit = true;
 
        grdItems.Rebind();
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.Print("Error: " + ex.ToString());
        Exceptions.ProcessModuleLoadException(this, ex);
    }
}

I have a button which needs to look at each row's check box and remove any items that are checked (perfromed by the CleanUpData method).  The button's click handler is:
protected void btnUpdateCart_Click(object sender, EventArgs e)
{
    try
    {
        //grdItems.MasterTableView.Items[grdItems.MasterTableView.Items.Count - 1].FireCommandEvent("UpdateAll", string.Empty);
        grdItems.EditItems[0].FireCommandEvent("UpdateEdited", string.Empty);
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.Print("Error: " + ex.ToString());
        Exceptions.ProcessModuleLoadException(this, ex);
    }
}

Here is the UpdateCommand event from the grid's code:
protected void grdItems_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    GridEditableItem itmUpdatedRow = null;
    Hashtable tblUpdatedValues = null;
 
    try
    {
        //Get the details of the item that needs to be updated
        itmUpdatedRow = e.Item as GridEditableItem;
        tblUpdatedValues = new Hashtable();
 
        //Parse out the updated data
        e.Item.OwnerTableView.ExtractValuesFromItem(tblUpdatedValues, itmUpdatedRow);
 
        //Update the underlying data table with the updated information (THIS IS ALWAYS FALSE REGARDLESS OF CHECKED STATUS)
        _propsSettings.Records.Rows[e.Item.DataSetIndex]["Checked"] = tblUpdatedValues["Checked"].ToString().GetBoolean();
 
        grdItems.Rebind();
 
        CleanUpData();
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.Print("Error: " + ex.ToString());
        Exceptions.ProcessModuleLoadException(this, ex);
    }
    finally
    {
        SaveControlState();
 
        //Clean up
        if (tblUpdatedValues != null)
        {
            tblUpdatedValues.Clear();
            tblUpdatedValues = null;
        }
    }
}

Here, the line that uses 'tblUpdatedValues["Checked"]' is ALWAYS False regardless of the check boxes status.  I had a similar issue before using a dropdown column but I got around that by changing it's editor to a standard ASP.NET dropdown.  I tried doing the same here but I got the same results.  The value of the Checked column is ALWAYS False no matter what I do.

This method shouldn't matter but I'm including it for completeness' sake (this code would only have an impact if at least 1 checkbox is detected as checked):
/// <summary>
/// Cleans up the Items grid data to make sure any invalid rows are removed.
/// </summary>
private void CleanUpData()
{
    try
    {
        _propsSettings.TotalPrice = 0;
        _propsSettings.ShippingTotal = 0;
        _propsSettings.LateFees = 0;
 
        if (_propsSettings.Records.Rows.Count > 0)
        {
            //Start at the end so that removing rows won't cause the index to be incorrect
            for (int iItems = (_propsSettings.Records.Rows.Count - 1); iItems > -1; iItems--)
            {
                try
                {
                    //Item was selected for removal
                    if (_propsSettings.Records.Rows[iItems][0].ToString().GetBoolean())
                    {
                        //Delete the line item database record and remove it from the data set
                    }
                    else
                    {
                        //Track the calculated totals
                        _propsSettings.ShippingTotal += _propsSettings.Records.Rows[iItems]["ShippingPrice"].ToString().GetNumber();
                        _propsSettings.TotalPrice += ((_propsSettings.Records.Rows[iItems]["OriginalPrice"].ToString().GetNumber() * _propsSettings.Records.Rows[iItems]["Quantity"].ToString().GetNumber()) + _propsSettings.Records.Rows[iItems]["ShippingPrice"].ToString().GetNumber());
 
                    }
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.Print("Error: " + ex.ToString());
                }
            }
        }
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.Print("Error: " + ex.ToString());
        Exceptions.ProcessModuleLoadException(this, ex);
    }
    finally
    {
        SaveControlState();
 
        UpdateCartTotals();
        grdItems.Rebind();
    }
}


I've searched the forums, read the help articles, looked at the demos, but cannot figure out what is wrong.  Any ideas?
J
Top achievements
Rank 1
 answered on 26 Mar 2013
5 answers
118 views
Can someone look at this and see what style I need to modify to get rid of the white space or image that is appearing at the bottom of the radComboBox? 

I assume it's a styling issue.  This happens while rendering in IE7.

Thanks, Dave.

Hristo Valyavicharski
Telerik team
 answered on 26 Mar 2013
2 answers
75 views
Hello everyone,

I have a question with regards to Radscheduler date display. By default, my scheduler will only show MonthView. For some reasons, the first day of the month always shows as MMM dd format. I want it to show a single digit day but the closest I'm able to do it is by changing the attribute FirstDayHeaderDateFormat to take a value of "dd", which effectively turns it into 01.

I tried supplying it a value of "d" but to no avail. When I used "d", I ended up with 01/03/2013 format. Is there anyway to keep the first day of the month to single digit?

Thanks in advance.
Jonathan
Top achievements
Rank 2
 answered on 26 Mar 2013
2 answers
172 views
I have a radGrid control with that loads a binary image from a sqlDataSource in a GridBinaryImageColumn. It works fine, but I attached an onclick event with code behind, and use a javascript/jquery block code to zoom the image.

The problem is that the image is downloaded using the height/width properties, and when I resize the image, it is grainy, because it was set to resize mode fit. This is great because the image is small so the download is fast.

However, I am using a jQuery Light Box to display the image when it is clicked. Code works fine, except I am using the link from the cell.innerHTML to load the image in a lightbox, and this is the code:

var selectedCell = args.get_gridDataItem().get_cell("UploadPicture");
var image = selectedCell.innerHTML;
var myHref = $(image).attr('src');
 
The src is something like src="Telerik.Web.UI.WebResource.axd?imgid=c7c37cd7e2874a99a04cfe282e769c95&type=rbi"

The image loads fine, however, if I try to resize the image using height/width attributes, the image becomes grainy because the original image that was downloaded was compressed to the settings in the grid control.

Question, is there an easy way to use the Telerik.Web.UI.WebResource.axd?imgid method to call a different size of the same image?

Or, is there an easier way to accomplish this?

Thanks in advance.

Henry
Top achievements
Rank 1
 answered on 26 Mar 2013
3 answers
177 views
Is it possible to add context menu to each node in the Orag chart.
Kate
Telerik team
 answered on 26 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?