Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
99 views
Hi,

I have a problem about adjust legend text. Text are so long and leave the legend area.

I agree photo to save problems.

radChart2.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Right;
            radChart2.Legend.Appearance.Location = Telerik.Charting.Styles.LabelLocation.OutsidePlotArea;
            radChart2.Legend.Appearance.Border.Color = Color.Green;
            radChart2.Legend.Appearance.Border.Width = 2;
            radChart2.Legend.Appearance.FillStyle.MainColor = Color.Yellow;
            radChart2.Legend.Appearance.Dimensions.AutoSize = false;
            radChart2.Legend.Appearance.Dimensions.Width = 200;
            radChart2.Legend.Appearance.Dimensions.Height = 300;
            radChart2.Legend.Appearance.ItemTextAppearance.Position.Auto = true;
            radChart2.Legend.Appearance.ItemAppearance.
            radChart2.Legend.Visible = true;

Thanks,

VĂ­ctor.

Evgenia
Telerik team
 answered on 22 Mar 2011
3 answers
178 views
I have make a scheduler based on your exemple. It Wok well, his is my method to inizialize object and dataBound
http://localhost:8301/radcontrols_aspnetajax/scheduler/examples/bindtolist/defaultcs.aspx

private void InitializeResources()
        {
  
            ResourceType resType = new ResourceType("User", false);
  
            resType.ForeignKeyField = "UserID";
            resType.Name = "User";
  
            RadScheduler1.ResourceTypes.Add(resType);
  
            //add uer
            DataView listUser = (DataView)ObjectDataSourceFilterContatti.Select();
  
            foreach (DataRow user in listUser.Table.Rows)
            {
                int key = Convert.ToInt32(user["idAnagrafica"]);
                string value = user["Nome"].ToString();
  
                Resource r = new Resource("User", key, value);
                RadScheduler1.Resources.Add(r);
            }
                 }
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            //recupero l'utente collegato all'appuntamento
            Resource userRes = e.Appointment.Resources.GetResourceByType("User");
            if (userRes != null)
            {
                string key = userRes.Key.ToString();
                   //DO SOMETHING...............
            }                    
}
now, if I change the InitializeResources() method in this way
ResourceType resType = new ResourceType("User", false);
            resType.DataSourceID = "ObjectDataSourceFilterContatti";
            resType.ForeignKeyField = "UserID";
            resType.KeyField = "idAnagrafica";
            resType.TextField = "Nome";
            resType.Name = "User";
            RadScheduler1.ResourceTypes.Add(resType);

it work on page load (the combo box User is populated correctly) but in past back during the method RadScheduler1_AppointmentDataBound in this row

Resource userRes = e.Appointment.Resources.GetResourceByType("User");

the userRes object is always null, why?
Veronica
Telerik team
 answered on 22 Mar 2011
3 answers
162 views
Currently it has a width assigned via stylesheet to 160px. How can I change this?

Shinu
Top achievements
Rank 2
 answered on 22 Mar 2011
1 answer
141 views
hey there,

how can i use Hierarchical radgrid with advance data binding??..Where should i call NeedDataSource events for detail and master grid??..

thanks
Amit
Princy
Top achievements
Rank 2
 answered on 22 Mar 2011
2 answers
406 views
Hi,

I have one Radtreeview in the left side and Radgrid in the rightside.
Radtreeview binded dynamically. Its working fine.
private void BuildDataTable()
    {
        DataTable data = new DataTable();
        data.Columns.Add("parent_id");
        data.Columns.Add("child_id");
        data.Columns.Add("child_code");

        data.Rows.Add(null, "25", "AF-Angel Falls");
        data.Rows.Add(null, "26", "RR-Rapid Run");
        data.Rows.Add("25", "38", "P1-Phase1");
        data.Rows.Add("26", "39", "P1-Phase1");
        data.Rows.Add("38", "172", "001-Lot1");
        data.Rows.Add("38", "173", "002-Lot2");
        data.Rows.Add("38", "174", "003-Lot3");
        data.Rows.Add("38", "175", "004-Lot4");
        data.Rows.Add("38", "176", "005-Lot5");
        data.Rows.Add("39", "177", "001-Lot1");
        data.Rows.Add("39", "178", "002-Lot2");
        data.Rows.Add("39", "179", "003-Lot3");
        data.Rows.Add("39", "180", "004-Lot4");
        data.Rows.Add("39", "181", "005-Lot5");

        RadTreeView1.DataFieldID = "child_id";
        RadTreeView1.DataFieldParentID = "parent_id";
        RadTreeView1.DataTextField = "child_code";
        RadTreeView1.DataValueField = "child_id";
        RadTreeView1.ExpandAnimation.Duration = 100;
        RadTreeView1.DataSource = data;
        RadTreeView1.DataBind();
    }

when i select childnode (Lot1), based on childnode value i have to populate radgrid in the rightside.

private void BindRadGrid()
    {
       string selectedNodevalue = RadTreeView1.SelectedNode.Value; // Get the selected node value (ID)

        // Set the grid DataSource
        conn = new MySqlConnection(connString);
        MySqlDataAdapter adapter = new MySqlDataAdapter();
        string query = "SELECT distinct tsa.org_finish_Date,mjt.jobtype_code,tsap.total_float,tsap.activity_desc,tsap.original_duration, " +
                "tsap.early_start_display,tsap.early_finish_display, tsap.actual_start,tsap.actual_finish,tsap.pct,mdrc.delay_reason_code_id, " +
                "mdrc.delay_reason_code,tsap.delay_days,tsap.act_log,tsap.rem_duration, tsap.mandatory_start,tsap.mandatory_finish " +
                "from tsm_schedule_activities_publish_s tsap " +
                "inner join tsm_schedule ts on tsap.schedule_id=ts.schedule_id " +
                "inner join tsm_schedule_activities tsa on tsap.schedule_id=tsa.schedule_id " +
                "inner join msm_delay_reason_codes mdrc on tsap.delay_reason_code_id=mdrc.delay_reason_code_id " +
                "inner join msl_jobtypes mjt on ts.jobtype_id=mjt.jobtype_id " +
                "inner join min_com_lots mcl on mcl.com_lot_id=ts.com_lot_id where mcl.lot_id="+selectedNodevalue;
        adapter.SelectCommand = new MySqlCommand(query, conn);
        // DataSet myDataSet = new DataSet();
        conn.Open();
        try
        {
            adapter.Fill(myDataSet, "tsm_schedule_activities_publish_s");
        }
        finally
        {
            conn.Close();
        }
        RadGrid1.DataSource = myDataSet;
        //RadGrid1.DataBind();
    }

  error is, "Object reference not set to an instance of an object".
I am getting an error in this area
string selectedNodevalue = RadTreeView1.SelectedNode.Value; // Get the selected node value (ID).

my final output is in the attachment, when i hard coded the childnode value i got output like this.

Thanks,
Nagendra.
Nagendra
Top achievements
Rank 1
 answered on 22 Mar 2011
1 answer
350 views
My data is being shown in RadGrid. i am trying to export data in Excel. Properties are set for the RadGrid
like
        rdGridCustomer.ExportSettings.FileName = "MyDataFile";
        rdGridCustomer.ExportSettings.ExportOnlyData = true;
        rdGridCustomer.ExportSettings.IgnorePaging = false ;
        rdGridCustomer.ExportSettings.OpenInNewWindow = true;
        rdGridCustomer.ExportSettings.Excel.FileExtension = "xls";
        rdGridCustomer.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.Html;

event on that Excel is being exported.
 protected void btnExport_Click(object sender, EventArgs e)
    {
       
        rdGridCustomer.MasterTableView.ExportToExcel();     
    }
   event of Radgrid that is generated error
   Index was outside the bounds of the array.
when below event is fired after btnExport_Click event error occurs. It occurs only when
rdGridCustomer.MasterTableView.ExportToExcel();     this code of line exceuted.
 protected void rgModuleGrid_PreRender(object sender, EventArgs e)
      {
          // Institute Maximum Page Size for Main Grid
          GridPagerItem pagerItem = (GridPagerItem)rdGridCustomer.MasterTableView.GetItems(GridItemType.Pager)[1];
          on this above bold line error occures.
          RadNumericTextBox textBox = (RadNumericTextBox)pagerItem.FindControl("ChangePageSizeTextBox");
       }
please give me solution.
Thanks.
Princy
Top achievements
Rank 2
 answered on 22 Mar 2011
1 answer
233 views
I'm using the U.S. calendar format convention, but was wondering if I can change the order in which the week appears in my calendars.  Right now it appears as Sunday, Monday,...Saturday.  I was wondering if there is a setting to start the week at Monday and have it finish on Sunday.  I have an application which is based on a weekday and weekend times, so it would help to be able to see the calendar is the same format.

Thanks
Shinu
Top achievements
Rank 2
 answered on 22 Mar 2011
2 answers
288 views

Hi there,

I'm loading a RadGrid with AutoGenerateColumns="true", for databinding I'm using NeedDataSource(...) event handler. Since I want to format values from some columns I use the ColumnCreated(...) event handler. I also want to do some Aggregation based on  the type of column. For this, I have the following helper method:

public static void ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)
        {
           
            if(!string.IsNullOrEmpty(e.Column.UniqueName))
            {
                GridBoundColumn gbc = e.Column as GridBoundColumn;

                if (gbc != null)
                {
                    gbc.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;

                    gbc.HeaderText = gbc.UniqueName.ToUpper() == "EXPANDCOLUMN" ? string.Empty : gbc.UniqueName;

                    switch (gbc.DataTypeName.ToUpper())
                    {
                        case "SYSTEM.DATETIME":
                            gbc.DataFormatString = "{0:d}";
                            break;
                        case "SYSTEM.DECIMAL":
                            gbc.DataFormatString = "{0:N2}";
                            gbc.Aggregate = GridAggregateFunction.Sum;
                            gbc.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                            gbc.FooterStyle.HorizontalAlign = HorizontalAlign.Right;
                            break;
                    }
                }               
            }
        }

But when this event fires something real "weird" is happening. I keep getting the following error:

Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: cannot find column [xxxxxx].

When I mean "weird" is that such column does exist!.

On the other hand, when I comment out the logic inside ColumnCreated(...) event, the error does not show up. But as you might expect... the values are not formatted as well as there is no Aggregation on the columns that I want, and I do really want the event to fire since I need to do some formatting on the values of certain columns.

Thanks in advance,

Felix


Today, I tried a different approach.  This time I used the ItemDataBound(...) event.

The code now is as follows:

protected void gvwOperaciones_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if(e.Item.ItemType == GridItemType.AlternatingItem ||
            e.Item.ItemType == GridItemType.Item)
        {
            int colIndex = 0;
            DataRowView drv = e.Item.DataItem as DataRowView;

            foreach (DataColumn dc in drv.DataView.Table.Columns)
            {
                GridDataItem gdi = e.Item as GridDataItem;
                switch (dc.DataType.ToString().ToUpper())
                {
                    case "SYSTEM.DATETIME":
                        gdi[dc.ColumnName].Text = string.Format("{0:d}", drv[dc.ColumnName]);                       
                        break;
                    case "SYSTEM.DECIMAL":
                        gdi[dc.ColumnName].Text = string.Format("{0:N2}", drv[dc.ColumnName]);
                        GridBoundColumn gbc = gvwOperaciones.MasterTableView.AutoGeneratedColumns[colIndex] as GridBoundColumn;
                        if(gbc != null)
                            gbc.Aggregate = GridAggregateFunction.Sum;
                        break;
                    default:
                        break;
                }
                colIndex++;
            }
        }
    }


But something interesting again!!!, this time if I comment out the lines:

GridBoundColumn gbc = gvwOperaciones.MasterTableView.AutoGeneratedColumns[colIndex] as GridBoundColumn;
if(gbc != null)
    gbc.Aggregate = GridAggregateFunction.Sum;


It works! but remember that the aggregation Does not occur!!!

Now as soon as I put them back again, the aforementioned error in javascript pops up again!!! 

Question:
Is it bug in RadGrid? Am I not coding the right way?

This is really driving me nuts! :-( Can some one, please shed some light on this?

Felix
Felix Ruben Melendez Batres
Top achievements
Rank 1
 answered on 21 Mar 2011
1 answer
71 views
What is the best way to dynamically assign the skin of a RadMenu control?

I've created a Sharepoint 2010 webpart, and exposed a text property named "Skin", which can be set when you modify the webpart.

I'd like to use the value of this property to change the skin once the property is set.

Therefore, I've used the following code in the PreRender event:

this.RadMenu1.Skin = WebPart.Skin.ToString();

but it doesn't seem to work... but I know the PreRender event is being fired - I can debug through it.

Is there a refresh that needs to be called after the line above?

Thanks in advance for your help.

Bill Richardson
Kalina
Telerik team
 answered on 21 Mar 2011
0 answers
115 views
It has recently come to our attention that our visitors using AOL is encountering problems when trying to use the Rad Controls we have placed on our site. 

Mostly around the RadDatePicker; from a user comment, "it shows that there is not a calendar icon to the right of the start and end date areas to click on to enter the start and end dates".

Is there any reports out that indicate AOL users are having problems with Telerik AJAX Controls?  Any insight in this at all?

We are gathering more information, as which browser they are using, but we are not receiving any other complaints from visitors NOT using AOL.

Any help or insight would be great!
Paul
Top achievements
Rank 2
 asked on 21 Mar 2011
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?