dsMsas = new DataSet(); //
dsMsas = df.GetMsas(); // it is getting from a database function class (all sales persons)
for (int i = 0; i < dsMsas.Tables[0].Rows.Count; i++)
{
Telerik.WinControls.UI.
RadChart rc = new Telerik.WinControls.UI.RadChart();
rc = (Telerik.WinControls.UI.
RadChart) radChart1.Clone();
try
{
string intMsaCode = dsMsas.Tables[0].Rows[i][0].ToString();
DataSet ds = new DataSet();
ds = df.GetMI(intMsaCode); //get Market Index data for sales persons
Double dblMinValue = 0, dblMaxValue = 0;
ChartSeries miDataSeries = rc.GetSeries("Series 1"); // only one serie in the chart
rc.ChartTitle.TextBlock.Text =
"MI " + ds.Tables[0].Rows[0][2].ToString() + " / " + ds.Tables[0].Rows[0][3].ToString();
if (miDataSeries != null)
{
dblMinValue =
Convert.ToDouble(ds.Tables[0].Rows[0][1]);
dblMaxValue = dblMinValue;
miDataSeries.DefaultLabelValue =
"#Y{N0}";
foreach (DataRow dbRow in ds.Tables[0].Rows)
{
if (dblMinValue > Convert.ToDouble(dbRow["pdMIMS"]))
dblMinValue =
Convert.ToDouble(dbRow["pdMIMS"]);
if (dblMaxValue < Convert.ToDouble(dbRow["pdMIMS"]))
dblMaxValue =
Convert.ToDouble(dbRow["pdMIMS"]);
rc.PlotArea.XAxis.AddItem(dbRow[
"psMonthName"].ToString().Substring(0, 3));
miDataSeries.AddItem(
Convert.ToDouble(dbRow["pdMIMS"]));
}
}
double dblAvgValue = Convert.ToInt32((dblMaxValue - dblMinValue) / ds.Tables[0].Rows.Count);
rc.PlotArea.YAxis.MaxValue =
Convert.ToDouble(Convert.ToInt32(dblMaxValue) + dblAvgValue);
rc.PlotArea.YAxis.MinValue =
Convert.ToDouble(Convert.ToInt32(dblMinValue) - dblAvgValue);
int intStep = Convert.ToInt32((rc.PlotArea.YAxis.MaxValue - rc.PlotArea.YAxis.MinValue) / ds.Tables[0].Rows.Count);
rc.PlotArea.YAxis.Step = intStep <= 0 ? 1 : intStep;
rc.Save(
"MainPageImages/MI/" + intMsaCode + "_MI.png", System.Drawing.Imaging.ImageFormat.Png);
//after this part the memory is going higher, when i throw this part there is nothing happened, no memory usage.
miDataSeries.Clear();
rc.PlotArea.YAxis.Clear();
rc.PlotArea.XAxis.Clear();
rc.Dispose();
rc =
null;
}
catch (Exception ex)
{
//nothing
string strE = ex.Message;
}
}
dsMsas =
null;
*****************************************Hi,
I would like to use the multicolumn combobox as a lookup combobox. If I setup the mc combo with the same properties as a normal combobox it gives me the following message.
---------------------------
RadGridView Default Error Dialog
---------------------------
The following exception occurred in the RadGridView:
System.Data.ReadOnlyException: Column 'BusID' is read only.
at System.Data.DataRow.set_Item(DataColumn column, Object value)
at System.Data.DataRowView.SetColumnValue(DataColumn column, Object value)
at System.Data.DataColumnPropertyDescriptor.SetValue(Object component, Object value)
at Telerik.WinControls.Data.DataAccessComponent.set_Item(GridViewRowInfo row, GridViewDataColumn column, Object value)
To replace this default dialog please handle the DataError event.
---------------------------
OK
---------------------------
These are the (in my opinion) relevant designer.cs entry's
// cmbJourneyBus(multicolumncombobox) | |
this.cmbJourneyBus.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.journeyBindingSource, "BusID", true)); | |
this.cmbJourneyBus.DataSource = this.busBindingSource; | |
this.cmbJourneyBus.DisplayMember = "BusNumber"; | |
this.cmbJourneyBus.ValueMember = "BusID"; | |
// radComboBox1 (standard radcombobox) | |
this.radComboBox1.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.journeyBindingSource, "BusID", true)); | |
this.radComboBox1.DataSource = this.busBindingSource; | |
this.radComboBox1.DisplayMember = "BusNumber"; | |
this.radComboBox1.ValueMember = "BusID"; |
Am I doing something wrong or is this a bug?
Kind regards,
Edwin Dirkzwager
CIP Software BV
The Netherlands.