Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
98 views
Hello,

I have a RadComboBox that contains a RadTreeView.  I am using the ItemTemplate to display the tree view.  My question is, besides displaying the Tree View, I would also like to add a single item to the RadComboBox where Text = "All" and Value = "0".  So, the RadComboBox would display "All" and the below that, it would display the RadTreeView.

Is this possible to do?

Thanks,
Dave
Princy
Top achievements
Rank 2
 answered on 25 Feb 2010
2 answers
109 views
Hi,

I have a chart -

<telerik:RadChart ID="RadChart1" runat="server" ChartImageFormat="Jpeg" Height="500px" 
                Width="1400px" DefaultType="Line" Skin="Office2007">  
                <Series> 
                    <telerik:ChartSeries DataXColumn="OAdate" DataYColumn="nosearches" Name="User Visits" 
                        Appearance-LineSeriesAppearance-Width="2" Type="Line">  
                        <Appearance> 
                            <FillStyle FillType="Solid" MainColor="69, 115, 167">  
                            </FillStyle> 
                            <TextAppearance TextProperties-Color="Black">  
                            </TextAppearance> 
                            <Border Color="69, 115, 167" /> 
                        </Appearance> 
                    </telerik:ChartSeries> 
                    <%--                <telerik:ChartSeries DataXColumn="OAdate" DataYColumn="errorscount" Name="Errors" 
                    Appearance-LineSeriesAppearance-Width="10" Type="Line">  
                    <Appearance> 
                        <LineSeriesAppearance Width="1" /> 
                        <FillStyle MainColor="Black" /> 
                    </Appearance> 
                </telerik:ChartSeries> 
--%> 
                </Series> 
                <PlotArea> 
                    <XAxis AutoScale="true" IsZeroBased="false">  
                        <Appearance ValueFormat="ShortDate" CustomFormat="" Color="134, 134, 134" MajorTick-Color="134, 134, 134">  
                            <MajorGridLines Color="134, 134, 134" Width="0" /> 
                            <TextAppearance TextProperties-Color="Black">  
                            </TextAppearance> 
                        </Appearance> 
                        <AxisLabel> 
                            <TextBlock> 
                                <Appearance TextProperties-Color="Black">  
                                </Appearance> 
                            </TextBlock> 
                        </AxisLabel> 
                    </XAxis> 
                    <YAxis> 
                        <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134" MinorTick-Color="134, 134, 134">  
                            <MajorGridLines Color="134, 134, 134" /> 
                            <MinorGridLines Color="134, 134, 134" /> 
                            <TextAppearance TextProperties-Color="Black">  
                            </TextAppearance> 
                        </Appearance> 
                        <AxisLabel> 
                            <TextBlock> 
                                <Appearance TextProperties-Color="Black">  
                                </Appearance> 
                            </TextBlock> 
                        </AxisLabel> 
                    </YAxis> 
                    <Appearance Dimensions-Margins="5%, 5%, 5%, 5%">  
                        <FillStyle FillType="Solid" MainColor="">  
                        </FillStyle> 
                    </Appearance> 
                </PlotArea> 
                <Appearance> 
                    <Border Color="134, 134, 134" /> 
                </Appearance> 
                <ChartTitle> 
                    <Appearance> 
                        <FillStyle MainColor="">  
                        </FillStyle> 
                    </Appearance> 
                    <TextBlock> 
                        <Appearance TextProperties-Color="Black" TextProperties-Font="Arial, 18px">  
                        </Appearance> 
                    </TextBlock> 
                </ChartTitle> 
                <Legend> 
                    <Appearance Dimensions-Margins="15%, 2%, 1px, 1px" Dimensions-Paddings="2px, 8px, 6px, 3px">  
                        <ItemTextAppearance TextProperties-Color="Black">  
                        </ItemTextAppearance> 
                        <ItemMarkerAppearance Figure="Square">  
                        </ItemMarkerAppearance> 
                    </Appearance> 
                </Legend> 
            </telerik:RadChart> 

Which displays fine on first databind, but on rebinding with new data on this button press the old chart stays on screen?

protected void searchButton_Click(object sender, EventArgs e)  
    {  
        Report report = new Report();  
        RadChart1.DataSource = report.RetrieveSSPhraseDailysp(keyword, 99, 1, fromRadDatePicker.SelectedDate, toRadDatePicker.SelectedDate);  
        RadChart1.DataBind();  
 
        phraseGridView.Rebind();  
    } 

What am i doing wrong?

Thanks
Matt
Matt
Top achievements
Rank 1
 answered on 25 Feb 2010
6 answers
234 views
I am setting the sort order in the code behind (programatically) and I would like to have the sorting indicators displayed while not allowing the user the ability to change the sort order.

By setting the AllowSorting = true the indicators will show correctly, however, the user can then change the sort order.
Sebastian
Telerik team
 answered on 25 Feb 2010
3 answers
117 views
Hi all

Have a Radmenu with Items. 

There are more than 10 RadMenuItems so it overflows and shows in the second line.

Then i used EnableRootItemScroll = "true" and width to 80%, Even though it shows in the second line but with the scroll.

I have attached the screen shot too.

I need to bring the all the items in a single line with scroll.

Thanking You

-Anto


Kamen Bundev
Telerik team
 answered on 25 Feb 2010
1 answer
140 views
Hi everyone,

a) Does anyone know if there are plans for an ASP.Net Ajax control for using BING Maps?

b) What's the proper way of integrating the Silverlight RadMap control in an ASP.Net page? I have users using browsers as old as IE6 (i know!!!) and I am concerned as to what they'll see if I host a Silverlight control in my page. Any ideas, suggestions, warnings? :-)

Jeppe Jespersen
Denmark

Ves
Telerik team
 answered on 25 Feb 2010
5 answers
369 views
I have a grid that uses paging, frozen headers and autogenerated columns.  My issue is when I click on the pager to get to the second row set all the checkboxes are disabled.  These work fine on the first page view but then after I click on the any page they are all disabled.  There is a <span disabled=disabled">checkbox</span> placed around them.  Can't seem to figure out what is causing this.

Thanks

<telerik:RadGrid ID="RadGrid1" AllowMultiRowEdit="true" EnableViewState="False" 
        AllowAutomaticUpdates="false" MasterTableView-EditMode="InPlace" runat="server"   
        AutoGenerateColumns="true" OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound" 
        onneeddatasource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender" AllowPaging="True" PageSize="50" PagerStyle-Mode="NextPrevNumericAndAdvanced">  
<MasterTableView EditMode="InPlace" ClientDataKeyNames="Product" TableLayout="Auto">  
</MasterTableView> 
<AlternatingItemStyle BackColor="AliceBlue" /> 
    <ClientSettings AllowKeyboardNavigation="false" EnableAlternatingItems="false" EnableRowHoverStyle="false">  
        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="2" /> 
 
        <Selecting AllowRowSelect="false" /> 
    </ClientSettings> 
</telerik:RadGrid> 
private DataTable _dt = null;  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            //Load the data  
            ddlContacts.DataBind();  
            if (ddlContacts.SelectedIndex == -1) { ddlContacts.SelectedIndex = 0; }  
            int contactUserID = 0;  
            Int32.TryParse(ddlContacts.SelectedValue, out contactUserID);  
            _dt = AFPI.Inventory.DAL.StoredProcedureCallerClasses.RetrievalProcedures.ProductUserEmailMatrix(contactUserID);  
            if (_dt.Rows.Count == 0)  
            {  
                RadGrid1.Visible = false;  
                lblNoRecords.Visible = true;  
                lblNoRecords.Text = string.Format("<font color=\"red\">Missing Information!</font><br />There are no users setup for {0}!<br /><br />Please <a href=\"EditContactUser.aspx?c={1}\">add</a> at least one user to setup user based emails settings.<br /><br />If every inventory notification will go to the same person <a href=\"EditContacts.aspx\">edit</a> the customer's To, CC and BCC settings.", ddlContacts.SelectedItem.Text, ddlContacts.SelectedValue);  
                return;  
            }  
            lblNoRecords.Visible = false;  
            RadGrid1.Visible = true;  
            DataRow row = _dt.Rows[0];  
            List<DataColumn> columnsToDelete = new List<DataColumn>();  
            for (int i = 0; i < _dt.Columns.Count; i++)  
            {  
                if (row[i].ToString().Length == 0)  
                {  
                    columnsToDelete.Add(_dt.Columns[i]);  
                }  
            }  
 
              
            foreach (DataColumn dc in columnsToDelete)  
            {  
                _dt.Columns.Remove(dc);  
            }  
 
            //Set the edit indexes of the grid so they show up in edit mode for the number of rows we are using.  
            for (int i = 0; i < _dt.Rows.Count; i++)  
            {  
                RadGrid1.EditIndexes.Add(i);  
            }  
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RemoveContactUserRecIds", "RemoveContactUserRecIds();", true);  
        }  
 
        //if AddMapping = false you should remove mapping.  
        [WebMethod]  
        public static void ChangeMapping(int ProductID, int UserID, bool AddMapping) {  
            Guid? currentUserGuid = UserUtil.getCurrentUserGuid(Membership.GetUser());  
            DateTime moment = DateTime.Now;  
            ProductEventEmailTargetMapEntity mapping = null;  
 
            ProductEventEmailTargetMapCollection existingEvents = new ProductEventEmailTargetMapCollection();  
            PredicateExpression f = new PredicateExpression();  
            f.Add(ProductEventEmailTargetMapFields.ContactUserRecId == UserID);  
            f.AddWithAnd(ProductEventEmailTargetMapFields.ProductRecId == ProductID);  
              
            if (existingEvents.GetDbCount(f) == 0)  
            {  
                mapping = new ProductEventEmailTargetMapEntity();  
                mapping.ContactUserRecId = UserID;  
                mapping.ProductRecId = ProductID;  
                mapping.ProductEventType = "Any";  
                mapping.CreatedBy = currentUserGuid;  
                mapping.CreatedDate = moment;  
            }  
            else  
            {  
                existingEvents.GetMulti(f);  
                mapping = existingEvents[0];  
            }  
            if (AddMapping)  
            {  
                mapping.DeletedBy = null;  
                mapping.DeletedDate = null;  
            }  
            else  
            {  
                mapping.DeletedDate = moment;  
                mapping.DeletedBy = currentUserGuid;  
            }  
              
            mapping.ModifiedBy = currentUserGuid;  
            mapping.ModifiedDate = moment;  
            mapping.Save();  
              
        }  
 
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                //Change the first column to readonly and bold  
                (RadGrid1.MasterTableView.AutoGeneratedColumns[0] as GridBoundColumn).ReadOnly = true;  
                (RadGrid1.MasterTableView.AutoGeneratedColumns[0] as GridBoundColumn).ItemStyle.Font.Bold = true;  
                //(RadGrid1.MasterTableView.AutoGeneratedColumns[0] as GridBoundColumn).ItemStyle.BackColor = System.Drawing.Color.LightGray;  
                //Set width to increase performance large dataset for IE  
                (RadGrid1.MasterTableView.AutoGeneratedColumns[0] as GridBoundColumn).HeaderStyle.Width = Unit.Pixel(200);  
                (RadGrid1.MasterTableView.AutoGeneratedColumns[0] as GridBoundColumn).ItemStyle.Width = Unit.Pixel(200);  
                  
                for (int i = 1; i < RadGrid1.MasterTableView.AutoGeneratedColumns.Length; i++ )  
                {  
                    (RadGrid1.MasterTableView.AutoGeneratedColumns[i] as GridCheckBoxColumn).HeaderStyle.Width = Unit.Pixel(100);  
                    (RadGrid1.MasterTableView.AutoGeneratedColumns[i] as GridCheckBoxColumn).ItemStyle.Width = Unit.Pixel(100);  
                    (RadGrid1.MasterTableView.AutoGeneratedColumns[i] as GridCheckBoxColumn).ReadOnly = false;  
                }  
            }  
        }  
 
        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            if (_dt == null) return;  
            //In order to get the checkboxes on all but the first row we have to recreate the datatable with columns 1 - n to boolean   
            //so the autogenerate columns knows to use a checkbox and not a textbox in edit mode.  
 
            //Copy the datatable structure  
            DataTable dtToBindTo = _dt.Clone();  
 
            // Loop through our new datatable setting the columns 1 - n to boolean  
            //We have to create a new datatable because once the datatable has data we can't change the datatype of the column  
            for (int i = 1; i < _dt.Columns.Count; i++)  
            {  
                dtToBindTo.Columns[i].DataType = System.Type.GetType("System.Boolean");  
            }  
 
            //Copy every row of our data to the new boolean table.  
            foreach (DataRow row in _dt.Rows)  
            {  
                dtToBindTo.ImportRow(row);  
            }  
            _dt.Dispose();  
            DataView dv = dtToBindTo.DefaultView;  
            dv.Sort = "Product";  
            //bind the data to the grid.  
            RadGrid1.DataSource = dv;  
              
        }  
        protected void RadGrid1_PreRender(object source, EventArgs e)  
        {  
            ConvertToActualHeaders();  
        }  
 
        private void ConvertToActualHeaders()  
        {  
            foreach (GridEditableItem edititem in RadGrid1.MasterTableView.GetItems(GridItemType.EditItem))  
            {  
                foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns)  
                {  
                    if (col.ColumnType == "GridBoundColumn")  
                    {  
                        if (edititem.IsInEditMode)  
                        {  
                            Literal txtbx = edititem[col.UniqueName].Controls[1] as Literal;  
                            string[] productValues = txtbx.Text.Split('_');  
                            txtbxtxtbx.Text = txtbx.Text.Replace("_" + productValues[productValues.Length - 1], "");  
                        }  
                    }  
                }  
            }  
 
              
        }  
 
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
 
            if (e.Item is GridDataItem)  
            {  
                GridDataItem dataItem = (GridDataItem)e.Item;  
                int numCols = RadGrid1.MasterTableView.AutoGeneratedColumns.Length;  
                  
                string productColumn = DataBinder.Eval(dataItem.DataItem, "Product").ToString();  
                int productID = 0;  
                string[] productColumnproductColumnArray = productColumn.Split('_');  
                  
                if (!Int32.TryParse(productColumnArray[productColumnArray.Length - 1], out productID))  
                {  
                    return;  
                }  
                  
 
                for (int i = 1; i < numCols; i++)  
                {  
                    CheckBox chk = dataItem[(RadGrid1.MasterTableView.AutoGeneratedColumns[i] as GridCheckBoxColumn).UniqueName].Controls[0] as CheckBox;  
                    string columnHeader = (RadGrid1.MasterTableView.AutoGeneratedColumns[i] as GridCheckBoxColumn).HeaderText;  
                    string[] userDataArray = columnHeader.Split('_');  
                    int userId = 0;  
                    if (Int32.TryParse(userDataArray[userDataArray.Length - 1], out userId))  
                    {  
                        chk.Attributes.Add("onclick", String.Format("checkboxClick({0}, {1}, this);", productID, userId));  
                    }  
                }  
            }  
        } 
MGrassman
Top achievements
Rank 2
 answered on 25 Feb 2010
1 answer
167 views
Hi, if I'm reading the documentation correctly, when my page loads and I prefill the rating control from a database, I should be using something like this:

cboAnalystRating.DbValue = dbReader(

"analystRating")

The problem is that it's not actually setting anything. If I use this:

 

cboAnalystRating.Value = dbReader(

"analystRating")

Then it works, but I get the usual can't convert DBNull to another format message.

What am I missing here?

 

Tsvetie
Telerik team
 answered on 25 Feb 2010
9 answers
205 views
When we use the radprogress for uploading file, we see the skin in IE, and in firefox (with some trouble with FF35, I think that they are now solved)... but in safari and chrome, we see the white progress without any skin.

This happened in our code, but also in the telerik demo page

http://demos.telerik.com/aspnet-ajax/upload/examples/customprogress/defaultcs.aspx

In this page, with the latest safari and chrome, we do not see the skin.

So if the official telerik demo have the bug, I suppose that this is not something we did not configure correctly on our side !

Kamen Bundev
Telerik team
 answered on 25 Feb 2010
2 answers
184 views
Hi. I'm using a RadGrid in a relatively default form, with AutoGenerateColumns="false" and EditMode="PopUp". The Edit form works great straight-out of the box, with the small exception of a textbox that I would like to make a textarea (multi-row textbox). Is there anyway to do this without going down the custom editform template route? Thanks, Chris
blue
Top achievements
Rank 1
 answered on 25 Feb 2010
4 answers
196 views
Hi,
I've a RadGrid with one column filtered with a RadComboBox.
Following support examples, I've seen that to clear the RadComboBox filter I've to reset the RadGrid1.MasterTableView.FilterExpression and I've to reset the CurrentFilterValue of the interested column.
This solution works well if I've selected only one filter.
But, if I've other filters applied in other columns, resetting the FilterExpression cause the other filters to be resetted too.
The only solution I've found is to manually rebuild the filterExpression, parsing the string with a complicated regular expression.
Is this the right solution?

Greetings
Marco

Pavlina
Telerik team
 answered on 25 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?