Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
134 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
358 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 <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 <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
161 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
201 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
182 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
186 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
3 answers
211 views
This usefulness of a control like this will be beyind measure.   However, in my opinion the current UI is not intuitive.  Even as a technical person I am having trouble figuring out how the ANDs and ORs relate to each and which things are being grouped together.  If i can't figure it out, there is no way my users will be able to figure it out.

I know its still early, but here is some general feedback:

1) It would be more intuitive if the filter clauses where structured like a familiar SQL where clause.  Currently, the first thing is the filter is a AND or OR.  That doesn't make intuitive sense.  What am I ANDing together?  Nothing yet.  

What if I only need 1 filter?  (OrderID = 123). 

The first thing in the filter should be an actual filter (ie.  OrderID=123), THEN have the ability to add AND or OR concatenators.

2) The drop down context menu on the "+" button needs some clarification.  After trial and error, I was able to figure out that the first option adds a filter clause to the chain and the second option adds a AND/OR concatenator.  But it is not intuitive. 

3) Add some type of grouping visual indicator.  I suggest the familiar parantheses as people understand that this groups things together and they can tell which items are being concatenated.   I think you could also accomplisht this with indentation, which appears to be the direction you are headed, but currently, it seems like you can only indent one direction.

Consider this difference:

WHERE
(OrderID > 100 AND OrderID < 200)
OR
(Country = "France")

versus:

WHERE
(OrderID  > 100 AND (OrderID < 200 OR Country = "France"))

There is a difference, but I couldn't figure out how to represent these using the UI.

4) Consider adding a text representation of the resulting WHERE clause so the user can see what they aare building to confirm it.
Nikolay Rusev
Telerik team
 answered on 25 Feb 2010
6 answers
236 views

I am using RAdGrid two level hierarchy and userContols as Edit and Insert forms.

After creating entry in MasterTable I would like to open insert form for child record automaticly.

Iana Tsolova
Telerik team
 answered on 25 Feb 2010
1 answer
57 views
I would like to plot two bars, of the same serie, with the same x-axis value next to each other instead of them overlapping each other, as can be seen in: http://www.telerik.com/help/aspnet-ajax/featuresstrictmode.html ( the two blue bars at x-ax = 3)

I cant find how, any help?
Vladimir Milev
Telerik team
 answered on 25 Feb 2010
1 answer
138 views
Hi,

I am using a radtreeview with a sqldatasource. The radtree looks like below:

NODE1
    Subnode1
    Subnode2
NODE2
    Subnode3
    Subnode4

I also have 4 radgrids on the page whose visibility is toggled on/off based on check/uncheck of the nodes. I achieved this by calling a javascript function on "OnClientNodeChecking". So far so good.

I also want to toggle the radgrids based on NODE1/NODE2 check/uncheck, i.e. if I uncheck NODE1, the two grids(associated with subnode1/2) should be hidden. So, I set the "CheckChildNodes" property to "True" which checks/unchecks the child nodes. I assumed that this would trigger the "OnClientNodeChecking" event for all the childs nodes. However, it doesn't. I am not sure if it is desgin issue or if I am missing something. Either way, I would appreciate if anyone can help me resolve this.

Thank you,
Sri
Shinu
Top achievements
Rank 2
 answered on 25 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?