Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
186 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
78 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
534 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
102 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
66 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
170 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
163 views
Is it possible to add context menu to each node in the Orag chart.
Kate
Telerik team
 answered on 26 Mar 2013
1 answer
122 views
I'm trying to created a grid hierarchy as outlined in this example. I'm using the DetailsTables method (as opposed to NestedViewTemplate) and I would like to put a GridClientSelectColumn on the sub-grid, allowing the user to select only one item from each sub-grid. When i set the parent's AllowMultiRowSelection="False", however, this causes all the sub-grid's to act as a single group, allowing the user to only select 1 item from ALL sub-grids. The definition for my grid is as follows

<telerik:RadGrid runat="server" ID="ledger" Width="900px" AllowSorting="true" AllowPaging="true" AutoGenerateColumns="false" PageSize="10" AllowFilteringByColumn="true" OnNeedDataSource="ledger_NeedDataSource" OnDetailTableDataBind="ledger_DetailTableDataBind" AllowMultiRowSelection="False">
  <GroupingSettings CaseSensitive="false" />
  <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="true">
    <Selecting AllowRowSelect="True"  UseClientSelectColumnOnly="True"/>
  </ClientSettings>
  <MasterTableView DataKeyNames="SubstanceId, Name, CAS" ClientDataKeyNames="SubstanceId"  
        ShowHeadersWhenNoRecords="true" CommandItemDisplay="None" Font-Size="10">
    <DetailTables>
      <telerik:GridTableView runat="server" Name="SuggestedComponents" PageSize="5"
            AllowFilteringByColumn="False" AllowSorting="False" AutoGenerateColumns="False" ShowFooter="True">
        <Columns>
          <telerik:GridBoundColumn HeaderText="Name" UniqueName="SuggestionPrimaryName"
               DataType="System.String" AllowSorting="False" AllowFiltering="False" DataField="PrimaryName" />
          <telerik:GridBoundColumn HeaderText="CAS" UniqueName="SuggestionCAS" DataType="System.String"
                AllowSorting="False" AllowFiltering="False" DataField="CAS" />
          <telerik:GridClientSelectColumn UniqueName="SuggestionSelect" />
        </Columns>
      </telerik:GridTableView>
    </DetailTables>
    <Columns>
      <telerik:GridBoundColumn AllowSorting="true" DataType="System.String" UniqueName="SubstanceName"
            HeaderText="Name" DataField="Name" />
      <telerik:GridBoundColumn AllowSorting="true" DataType="System.String" UniqueName="CAS"
            HeaderText="CAS" DataField="CAS" />
      <telerik:GridBoundColumn AllowSorting="true" DataType="System.String" UniqueName="ProductCode"
            HeaderText="Product Code" DataField="ProductCode" />
      <telerik:GridBoundColumn AllowSorting="true" DataType="System.String" UniqueName="ClientSubstanceId"
            HeaderText="Client ID" DataField="ClientSubstanceId" />
    </Columns>
  </MasterTableView>
</telerik:RadGrid>

How can I achieve a single-select-per-sub-grid behavior?
Kostadin
Telerik team
 answered on 26 Mar 2013
1 answer
58 views
It appears that with the latest release the sprite file for the radcombobox has changed. With the previous version we modified the photoshop file to create a "Required" image that would be substituted out if the combo failed validation. With this change our modified image no longer works. Is there a photoshop file available for the sprites for the latest version of the radcombobox?

Thanks,
Kate
Telerik team
 answered on 26 Mar 2013
22 answers
391 views
Hi All,

I was wondering if anyone is using the HierarchyID to create XML for the treeview control, or even better if Telerik is making a change to bind a treeview to a dataset with the HierarchyID datatype.

I found this post, but there was no follow up from Telerik.

Thanks
Mako
Top achievements
Rank 1
 answered on 26 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?