Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
117 views
Hi,
I was wondering if there are any built in functionalities in the radgrid to actually add a new row anywhere in the grid.  Say I click on the add button on the 5th row, so I would have the new 6th blank row.  


Cheers,
Josh
Josh
Top achievements
Rank 1
 answered on 04 Nov 2008
3 answers
327 views

My "load on demand" is extremely slow.  There are about 250,000 records in the table but I understood that even with this number of records the load-on-demand should have acceptable performance.  Please take a look at the code here and let me know if there's a setting somewhere which I'm missing.  When I click in the combobox it says "loading..." for minutes before anything shows up in the list.  Thanks.

ASPX:

<telerik:RadComboBox ID="rcbProductCode" runat="server" Width="250px" Height="200px"
 AllowCustomText="True" ShowToggleImage="True" ShowMoreResultsBox="true"
 EnableLoadOnDemand="True" MarkFirstMatch="True"
 OnItemsRequested="rcbProductCode_ItemsRequested" EnableVirtualScrolling="true" >
</telerik:RadComboBox>

VB.NET:

Protected Sub rcbProductCode_ItemsRequested(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)

Dim sql As String = _
    "SELECT PRODUCT = RTRIM(PRODUCT_CODE) + ' - ' + RTRIM(PRODUCT_DESC), PRODUCT_CODE " & _
    "FROM AllianceSync.DBO.FDA_PRODUCT (NOLOCK)  " & _
    "WHERE PRODUCT_CODE like '" + e.Text + "%'"

Dim connTmp As New SqlConnection(strConnString)
connTmp.Open()
Dim adapter As New SqlDataAdapter(sql, connTmp)
Dim data As New DataTable()
adapter.Fill(data)

Dim rcb As Telerik.Web.UI.RadComboBox = CType(o, Telerik.Web.UI.RadComboBox)
Try
    Dim itemsPerRequest As Integer = 10
    Dim itemOffset As Integer = e.NumberOfItems
    Dim endOffset As Integer = itemOffset + itemsPerRequest
    If endOffset > data.Rows.Count Then
        endOffset = data.Rows.Count
    End If

    If endOffset = data.Rows.Count Then
        e.EndOfItems = True
    End If
    Dim i As Integer = itemOffset
    While i < endOffset
        rcb.Items.Add(New Telerik.Web.UI.RadComboBoxItem(data.Rows(i)("PRODUCT").ToString(), data.Rows(i)("PRODUCT_CODE").ToString()))
        i = i + 1
    End While

    If data.Rows.Count > 0 Then
        e.Message = [String].Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), data.Rows.Count.ToString())
    Else
        e.Message = "No matches"
    End If
Catch
    e.Message = "No matches"
End Try

paul
Top achievements
Rank 2
 answered on 04 Nov 2008
0 answers
159 views
How does the WPF Ribbon control compare to the Telerik Toolbar?

http://windowsclient.net/wpf/wpf35/wpf-35sp1-ribbon-walkthrough.aspx

Do you have anything like the ribbon control?

thanks.

Moon
Top achievements
Rank 2
 asked on 04 Nov 2008
5 answers
185 views

I've seen other posts where people are having similar issues. I tried their suggestions and still no good. I cannot get this grid to fire the update command. I'm programmatically creating the grid and using a template edit form...


Grid setup:
  private void SetupStoreGridView()  
    {  
 
        // create columns   
        GridEditCommandColumn storeEditCol = new GridEditCommandColumn();  
        GridBoundColumn storeNumberCol = new GridBoundColumn();  
        GridBoundColumn storeNameCol = new GridBoundColumn();  
        GridBoundColumn storePhoneCol = new GridBoundColumn();  
        GridBoundColumn storeAddressCol = new GridBoundColumn();  
        GridBoundColumn storeCityCol = new GridBoundColumn();  
        GridBoundColumn storeStateCol = new GridBoundColumn();  
        GridBoundColumn storeZipCol = new GridBoundColumn();  
        GridBoundColumn storeDesignNameCol = new GridBoundColumn();  
        GridBoundColumn storeChocolixirCol = new GridBoundColumn();  
 
        // main grid properties  
        m_StoreGridViewRad = new RadGrid();  
        m_StoreGridViewRad.ID = "StoreGridViewRad";  
        m_StoreGridViewRad.GridLines = GridLines.Vertical;  
        m_StoreGridViewRad.AllowMultiRowSelection = false;  
        m_StoreGridViewRad.AutoGenerateColumns = false;  
        m_StoreGridViewRad.AllowSorting = true;  
        m_StoreGridViewRad.Skin = "WebBlue";  
        m_StoreGridViewRad.Width = Unit.Percentage(95);  
        m_StoreGridViewRad.UpdateCommand += new GridCommandEventHandler(m_StoreGridViewRad_UpdateCommand);  
        m_StoreGridViewRad.MasterTableView.AllowAutomaticUpdates = true;  
 
        m_StoreGridViewRad.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.Template;  
        m_StoreGridViewRad.MasterTableView.EditFormSettings.FormTemplate = new EditStoreTemplate();  
        m_StoreGridViewRad.NeedDataSource += new GridNeedDataSourceEventHandler(StoreGridViewRad_NeedDataSource);  
        m_StoreGridViewRad.AllowFilteringByColumn = true;  
 
        m_StoreGridViewRad.MasterTableView.DataKeyNames = new string[] { StoreAccess.StoreNumber };  
        m_StoreGridViewRad.MasterTableView.EnableNoRecordsTemplate = true;  
 
        // add columns to grid  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeEditCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeNumberCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeNameCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storePhoneCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeAddressCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeCityCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeStateCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeZipCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeDesignNameCol);  
        m_StoreGridViewRad.MasterTableView.Columns.Add(storeChocolixirCol);  
 
        SetupGridViewColumn(storeNumberCol, StoreAccess.StoreNumber, "Store Number");  
        SetupGridViewColumn(storeNameCol, StoreAccess.StoreName, StoreAccess.StoreName);  
        SetupGridViewColumn(storePhoneCol, StoreAccess.Phone, StoreAccess.Phone);  
        SetupGridViewColumn(storeAddressCol, StoreAccess.Address, StoreAccess.Address);  
        SetupGridViewColumn(storeCityCol, StoreAccess.City, StoreAccess.City);  
        SetupGridViewColumn(storeStateCol, StoreAccess.State, StoreAccess.State);  
        SetupGridViewColumn(storeZipCol, StoreAccess.Zip, StoreAccess.Zip);  
        SetupGridViewColumn(storeDesignNameCol, StoreAccess.DesignName, "Design Name");  
        SetupGridViewColumn(storeChocolixirCol, StoreAccess.Chocolixir, StoreAccess.Chocolixir);  
 
        GridViewPlaceHolder.Controls.Add(m_StoreGridViewRad);  
    }  
 
    void m_StoreGridViewRad_UpdateCommand(object source, GridCommandEventArgs e)  
    {  
        GridEditableItem ei = ((GridEditableItem)(e.Item));  
        Hashtable t1 = new Hashtable();  
        ei.ExtractValues(t1);  
 
        string s = t1[StoreAccess.StoreName].ToString();  
    }  
 
 
 
 
    protected void StoreGridViewRad_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
    {  
        GetStoresToBind();  
    }  
 
    void SetupGridViewColumn(GridColumn col, string uniqueName, string heading)  
    {  
        col.HeaderText = heading;  
        col.UniqueName = uniqueName;  
        col.ItemStyle.HorizontalAlign = HorizontalAlign.Left;  
 
        if (col is GridBoundColumn)  
        {  
            GridBoundColumn bCol = col as GridBoundColumn;  
            bCol.DataField = uniqueName;  
        }  
        else if (col is GridButtonColumn)  
        {  
            GridButtonColumn buttonCol = col as GridButtonColumn;  
            buttonCol.CommandName = uniqueName;  
            buttonCol.Text = uniqueName;  
        }  
 
    } 

template:
public class EditStoreTemplate : IBindableTemplate  
{  
 
    public EditStoreTemplate()  
    {  
 
    }
    #region ITemplate Members  
 
    public void InstantiateIn(Control container)  
    {  
        GridEditFormItem item = ((GridEditFormItem)(container.NamingContainer));  
        if (item != null)  
        {  
            int index = ((GridDataItem)item.ParentItem).ItemIndex;  
 
            if (item.DataItem != null)  
            {  
 
                RadTextBox storeNumberTB = new RadTextBox()  
                {  
                    ID = "txtStorNumber",  
                    Text = DataBinder.Eval(item.DataItem, StoreAccess.StoreNumber, "{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(storeNumberTB);  
 
                RadTextBox storeNameTB = new RadTextBox()  
                {  
                    ID = "txtStoreName",  
                    Text = DataBinder.Eval(item.DataItem, StoreAccess.StoreName, "{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(storeNameTB);  
 
                RadTextBox addrTB = new RadTextBox()  
                {  
                    ID = "txtAddr",  
                    Text = DataBinder.Eval(item.DataItem, StoreAccess.Address, "{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(addrTB);  
 
                RadTextBox cityTB = new RadTextBox()  
                {  
                    ID = "txtCity",  
                    Text = DataBinder.Eval(item.DataItem, StoreAccess.City, "{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(cityTB);  
 
                RadTextBox stateTB = new RadTextBox()  
                {  
                    ID = "txtState",  
                    Text = DataBinder.Eval(item.DataItem, StoreAccess.State, "{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(stateTB);  
 
                RadTextBox zipTB = new RadTextBox()  
                {  
                    ID = "txtZip",  
                    Text = DataBinder.Eval(item.DataItem, StoreAccess.Zip, "{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(zipTB);  
 
                RadMaskedTextBox phoneTB = new RadMaskedTextBox()  
                 {  
                     ID = "txtPhone",  
                     Text = DataBinder.Eval(item.DataItem, StoreAccess.Phone, "{0}"),  
                     Skin = "WebBlue",  
                     CausesValidation = false 
                 };  
                container.Controls.Add(phoneTB);  
 
                RadTextBox notesTB = new RadTextBox()  
                {  
                    ID = "txtNotes",  
                    Text = DataBinder.Eval(item.DataItem, StoreAccess.Notes, "{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(notesTB);  
 
                RadComboBox designNameCombo = new RadComboBox()  
                {  
                    ID = "cboDesignName",  
                    DataSource = DesignAccess.GetDesign(),  
                    DataTextField = DesignAccess.DesignName,  
                    DataValueField = DesignAccess.DesignNumber,  
                    SelectedValue = DataBinder.Eval(item.DataItem, StoreAccess.DesignNumber, "{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(designNameCombo);  
 
                RadTextBox regionTb = new RadTextBox()  
                {  
                    ID= "txtRegion",  
                    Text    =  DataBinder.Eval(item.DataItem,StoreAccess.Reg,"{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(regionTb);  
 
                RadTextBox typeTB = new RadTextBox()  
                {  
                    ID = "txtType",  
                    Text= DataBinder.Eval(item.DataItem,StoreAccess.Type,"{0}"),  
                    Skin = "WebBlue",  
                    CausesValidation = false 
                };  
                container.Controls.Add(typeTB);  
 
 
                CheckBox chocolixirCB = new CheckBox()  
                {  
                    ID = "chkChocolixir",  
                    Checked = bool.Parse(DataBinder.Eval(item.DataItem, StoreAccess.Chocolixir, "{0}")),  
                    Text = StoreAccess.Chocolixir,  
                    CausesValidation = false 
                };  
                container.Controls.Add(chocolixirCB);  
 
                CheckBox gCB = new CheckBox()  
                {  
                    ID = "chkG",  
                    Checked = bool.Parse(DataBinder.Eval(item.DataItem, StoreAccess.G, "{0}")),  
                    Text = "G",  
                    CausesValidation = false 
                };  
                container.Controls.Add(gCB);  
 
                Button updateButton = new Button()  
                {  
                    ID = "updateButton",  
                    Text = "Update",  
                    CommandName = "Update",  
                    CausesValidation = false 
                };  
                container.Controls.Add(updateButton);  
 
                Button cancelButton = new Button()  
                {  
                    ID = "cancelButton",  
                    Text = "Cancel",  
                    CausesValidation = false 
                };  
                cancelButton.Click += new EventHandler(cancelButton_Click);  
                container.Controls.Add(cancelButton);  
            }  
        }  
    }  
 
    void cancelButton_Click(object sender, EventArgs e)  
    {  
         
    }
    #endregion  
 
    #region IBindableTemplate Members  
 
    public System.Collections.Specialized.IOrderedDictionary ExtractValues(Control container)  
    {  
        OrderedDictionary od = new OrderedDictionary();  
        od.Add(StoreAccess.StoreName,(container.FindControl("txtStoreName"as RadTextBox).Text);  
        return od;  
    }
    #endregion  

maybe i'm doing something wrong... but i'm pretty sure i followed the demo page closely. any help would be wonderful.

Thanks,
Dave
dave
Top achievements
Rank 1
 answered on 04 Nov 2008
1 answer
60 views
Hi Guys,

Could you provide me with the list of fixes for the radEditor going from 2008.2 826
version to 2008.2 1001 version?

Thanks.

Henry
Henry
Top achievements
Rank 1
 answered on 04 Nov 2008
2 answers
245 views
Hello,

Is there a good way to hide a button on the toolbar initially and show it through javascript?  I tried the Visible property but then the button control isn't put on the page so the only way to show it would be through a postback. 
I currently have it working by running javascript in the body onLoad but that causes the hidden buttons to show for a split second (or more on a slow machine/connection) before the javascript runs and hides them.

The scenario where I'm trying to use this is where we display data and we also have an Edit mode to update that data.  We want an Edit button displayed initially and when you click edit a javascript function is called where we will switch to an edit mode with the fields and also hide the Edit button and show a Save and Cancel button on the toolbar.

Any help is appreciated.

Thanks.
mzn developer
Top achievements
Rank 1
 answered on 04 Nov 2008
5 answers
773 views
Hi, All:

I have this error message with my RadCharts:

The file '/database/InventoryDatabase/Manhattan/QuestManhChart.aspx' has not been pre-compiled, and cannot be requested.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The file '/database/InventoryDatabase/Manhattan/QuestManhChart.aspx' has not been pre-compiled, and cannot be requested.

What is the reason, and how to fix it?

Thank you for your help.

Stanley
Ryan
Top achievements
Rank 1
 answered on 04 Nov 2008
1 answer
90 views
Can anyone tell me if it is possible to get scroll bars in the appointments (with long text) displayed in the scheduler.If yes then how can we get them?
john
Top achievements
Rank 1
 answered on 04 Nov 2008
4 answers
202 views
How can i remove the postback when i click in a node of the RadTree??

As far as i know, PostBack happens when i handle the event 'onnodeclick', but i need to use this method to catch the value of the clicked node.

Not use "__doPostBack()"

How can i acomplish that?

$create(Telerik.Web.UI.RadTreeView, {"_postBackDEFANGED_OnClick":true,"_postBackOnContextMenuItemClick":true,"_postBackReference":"__doPostBack(\u0027ctl00$filas$dckFilas$C$tevFilasPublicas\u0027,\u0027arguments\u0027)","_scrollPosition":0,"_skin":"Default","_uniqueId":"ctl00$filas$dckFilas$C$tevFilasPublicas","clientStateFieldID":"ctl00_filas_dckFilas_C_tevFilasPublicas_ClientState","collapseAnimation":"{\"type\":12,\"duration\":100}","contextMenuIDs":["MainContextMenu"],"expandAnimation":"{\"duration\":100}","nodeData":[{"value":"1"},{"value":"2"},{"value":"3"},{"value":"4"},{"value":"5"},{"value":"6"},{"value":"7","selected":1},{"value":"8"},{"value":"9"},{"value":"10"}],"selectedIndexes":["6"]}, null, null, $get("ctl00_filas_dckFilas_C_tevFilasPublicas"));
fabio selingrim
Top achievements
Rank 1
 answered on 04 Nov 2008
3 answers
95 views
I have a RADToolbar on  a page with 1 NavigationURL set as below

<telerik:RadToolbar ID="RadToolbar1" runat="server"    
            Style="clear: both; width: 100%;" AutoPostBack="True"   
            ononclick="RadToolbar1_OnClick" onbuttonclick="RadToolbar1_ButtonClick"   
            Skin="Web20"  > 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            <Items> 
                <telerik:RadToolbarButton runat="server" ButtonImage="new.gif"   
                    ButtonText="New Artist" Hidden="False" ID="RadToolbarButton1"   
                    ToolTip="New Artist" CommandName="newartist" DisplayType="TextImage"   
                    CausesValidation="False" Font-Bold="True" ForeColor="Black"   
                    ImageUrl="~/Img/addNewItem.gif" NavigateUrl="AddArtist.aspx" Text="New Artist"/>  
<telerik:RadToolBarButton runat="server" CommandName="bandmembers" ToolTip="Band Members"   
                    ButtonImage="People.gif" ButtonText="Band Members" Hidden="False"   
                    DisplayType="TextImage" Font-Bold="True" ForeColor="Black"   
                    ImageUrl="~/Img/People.gif" Text="Band Members"></telerik:RadToolBarButton> 
<telerik:RadToolBarButton runat="server" CommandName="artistmedia" ToolTip="Artist Media"   
                    ButtonImage="otherMedia.gif" ButtonText="Artist Media" Hidden="False"   
                    DisplayType="TextImage" Font-Bold="True" ForeColor="Black"   
                    ImageUrl="~/Img/Web4_ico_4.gif" Text="Media"></telerik:RadToolBarButton> 
            </Items> 
            <Items> 
                <telerik:RadToolbarButton runat="server" ButtonImage="People.gif" ButtonText="Band Members" Hidden="False" ID="RadToolbarButton3" ToolTip="Band Members" CommandName="bandmembers" DisplayType="TextImage"/>  
            </Items> 
            <Items> 
                <telerik:RadToolbarButton runat="server" ButtonImage="otherMedia.gif" ButtonText="Artist Media" Hidden="False" ID="RadToolbarButton2" ToolTip="Artist Media" CommandName="artistmedia" DisplayType="TextImage"/>  
            </Items> 
              
        </telerik:RadToolbar> 
 Clicking the 'Add New Artist' button doesnt navigate me to the AddArtist.aspx page, Im left on the main page.  Anyone know why ?
Erjan Gavalji
Telerik team
 answered on 04 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?