i'm generating EXT.NET gridview dynamically as below,
public GridPanel GetGridView()
{
return new GridPanel
{
Border = false,
ID = "grd",
Cls = "x-grid-custom",
StyleSpec = "margin-top:7px; margin-left:-2px",
Scroll = ScrollMode.Both,
OverflowX = Overflow.Auto,
EnableColumnHide = false,
ColumnLines = true,
ForceFit = false,
//Width = 1100,
EmptyText = "No rows to display",
Store = { this.CreateTabularStore() },
ColumnModel =
{
Columns = {
new DateColumn {ID="ED", Text = "Effective Date",Wrap = true,DataIndex = "ED",Format="dd MMM yyyy",Groupable = true, Html="<i class='prfl_unfilter_icon' onclick='return ShowGridFilter(this);'></i>" ,Width = 110},
new Column {ID="PRICE", Text = "Price",DataIndex = "PRICE",Groupable = true, Html="<i class='prfl_unfilter_icon' onclick='return ShowGridFilter(this);'></i>" ,Width = 70},
new Column {ID="CURRENCY", Text = "Currency",DataIndex = "CURRENCY",Groupable = true, Html="<i class='prfl_unfilter_icon' onclick='return ShowGridFilter(this);'></i>" ,Width = 80},
new Column {ID="OFFICIAL",Text = "Official Price",DataIndex = "OFFICIAL",Groupable = true, Html="<i class='prfl_unfilter_icon' onclick='return ShowGridFilter(this);'></i>" ,Width = 100},
new DateColumn {ID="MARKETED_EFFECTIVE_DATE", Text = "Marketed Effective Date",DataIndex = "MARKETED_EFFECTIVE_DATE",Format="dd MMM yyyy",Groupable = true, Html="<i class='prfl_unfilter_icon' onclick='return ShowGridFilter(this);'></i>" ,Width = 100},
new Column {ID="MARKETING_DESC", Text = "Marketed",DataIndex = "MARKETING_DESC",Groupable = true, Html="<i class='prfl_unfilter_icon' onclick='return ShowGridFilter(this);'></i>" ,Width = 80},
new DateColumn {ID="DISCONTINUED_TS", Text = "Date Discontinued",DataIndex = "DISCONTINUED_TS",Format="dd MMM yyyy",Groupable = true, Html="<i class='prfl_unfilter_icon' onclick='return ShowGridFilter(this);'></i>" ,Width = 100},
}
},
Features = {
new Grouping(){HideGroupedHeader=false }
},
View = { new Ext.Net.GridView() { LoadMask = true, LoadingText = "Loading..." } }
};
}
below is how i defined store in a method named CreateTabularStore():
Store store;
Model model;
store = new Store();
store.ID = "StorePD";
model = new Model();
model.Fields.AddRange(new ModelField[] {
new ModelField("ED",ModelFieldType.Date),
new ModelField("PRICE", ModelFieldType.Float),
new ModelField("CURRENCY"),
new ModelField("OFFICIAL"),
new ModelField("MARKETED_EFFECTIVE_DATE",ModelFieldType.Date),
new ModelField("MARKETING_STATUS_DESC"),
new ModelField("DISCONTINUED_TS",ModelFieldType.Date)
}
);
when i filter grid with DateColumn filter, grid columns are rendering distorted in IE 8 Browser as shown in the image below
Related
I use ExcelDataReader.DataSet nuggetPackage
var reader = ExcelReaderFactory.CreateReader(stream);
var conf = new ExcelDataSetConfiguration
{
UseColumnDataType = true,
FilterSheet = (tableReader, sheetIndex) => true,
ConfigureDataTable = (tableReader) => new ExcelDataTableConfiguration()
{
EmptyColumnNamePrefix = "Column",
UseHeaderRow = false,
}
}
};
var dataSet = reader.AsDataSet(conf);
I have the data in the dataset but some characters became ? (é => ?, ç => ?)
i try to use ExcelReaderConfiguration but i didn't find how to use dataset with this.
var readerConf = ExcelReaderFactory.CreateReader(stream, new ExcelReaderConfiguration()
{
FallbackEncoding = Encoding.GetEncoding(1252),
AutodetectSeparators = new char[] { ',', ';', '\t', '|', '#' },
LeaveOpen = false,
AnalyzeInitialCsvRows = 0,
});
I'm using BOT Framework v 3 i have an adaptive card that takes input from the user and i want the values in Dropdown to be dynamic is it possible.here is the adaptive card design code as you can see I have entered the choices manually instead it want it to be dynamic from the database
var card = new AdaptiveCard()
{
Body = new List<CardElement>()
{
new TextBlock()
{
Color = TextColor.Attention,
Weight = TextWeight.Bolder,
Size = TextSize.Medium,
Text = "Select a title",
},
new ChoiceSet()
{
Id = "title",
Style = ChoiceInputStyle.Compact,
IsRequired = false,
IsMultiSelect = false,
Value = "1",
Choices = new List<Choice>()
{
new Choice()
{
Title = "Swiss cargo",
Value = "Swiss cargo",
},
new Choice()
{
Title = "ticket booking",
Value = "ticket booking",
},
},
},
},
};
Assuming you can get your data into a list of strings, your Adaptive Card can easily be constructed dynamically using Linq. If you want to keep using the same Adaptive Cards library, it would look like this:
var data = new List<string> { "Swiss cargo", "ticket booking" };
var card = new AdaptiveCard()
{
Body = new List<CardElement>()
{
new TextBlock()
{
Color = TextColor.Attention,
Weight = TextWeight.Bolder,
Size = TextSize.Medium,
Text = "Select a title",
},
new ChoiceSet()
{
Id = "title",
Style = ChoiceInputStyle.Compact,
IsRequired = false,
IsMultiSelect = false,
Value = "1",
Choices = data.Select(item => new Choice { Title = item, Value = item }).ToList(),
},
},
};
I am currently performing a SuiteTalk search via C# that joins multiple tables, one of which is for Sales Orders. When performing a typical GET on a SalesOrder record, the property customFieldList gets populated with an array of transaction custom fields/etc. I am curious how to get the same when doing a search like:
SearchResult searchResult = Client.Service.search(new TransactionSearchAdvanced()
{
criteria = new TransactionSearch()
{
basic = new TransactionSearchBasic()
{
type = new SearchEnumMultiSelectField()
{
#operator = SearchEnumMultiSelectFieldOperator.anyOf,
operatorSpecified = true,
searchValue = new String[] { "_salesOrder" },
},
lastModifiedDate = new SearchDateField()
{
#operator = SearchDateFieldOperator.after,
operatorSpecified = true,
searchValue = fromLastModifiedDateTime.ToUniversalTime(),
searchValueSpecified = true
}
},
},
columns = new TransactionSearchRow()
{
basic = new TransactionSearchRowBasic()
{
internalId = new SearchColumnSelectField[] { new SearchColumnSelectField() },
tranId = new SearchColumnStringField[] { new SearchColumnStringField() },
tranDate = new SearchColumnDateField[] { new SearchColumnDateField() },
dateCreated = new SearchColumnDateField[] { new SearchColumnDateField() },
item = new SearchColumnSelectField[] { new SearchColumnSelectField() },
quantity = new SearchColumnDoubleField[] { new SearchColumnDoubleField() },
lastModifiedDate = new SearchColumnDateField[] { new SearchColumnDateField() },
email = new SearchColumnStringField[] { new SearchColumnStringField() },
//customFieldList = new SearchColumnCustomField[] { },
},
itemJoin = new ItemSearchRowBasic()
{
itemId = new SearchColumnStringField[] { new SearchColumnStringField() },
type = new SearchColumnEnumSelectField[] { new SearchColumnEnumSelectField() },
},
customerJoin = new CustomerSearchRowBasic()
{
internalId = new SearchColumnSelectField[] { new SearchColumnSelectField() },
billAddress = new SearchColumnStringField[] { new SearchColumnStringField() },
companyName = new SearchColumnStringField[] { new SearchColumnStringField() },
phone = new SearchColumnStringField[] { new SearchColumnStringField() },
email = new SearchColumnStringField[] { new SearchColumnStringField() },
},
customSearchJoin = new CustomSearchRowBasic[]
{
},
}
});
The property I want populated is commented out within the TransactionSearchRowBasic object:
//customFieldList = new SearchColumnCustomField[] { },
Any ideas? Thank you in advance!
The search operation doesn't return as much information as a GET operation does on the SuiteTalk Web Services.
For each record that is returned in your SearchResult, use the internalId or document number to GET that record. This should then include your custom fields.
NetSuiteService _service = new NetSuiteService();
ReadResponse res = _service.get(new RecordRef { internalId = internalID, type = RecordType.salesOrder, typeSpecified = true });
This code which initializes an array with two hard-coded values is working perfectly fine:
var db = new GoogleGraph {
cols = new ColInfo[] {
new ColInfo { id = "", label = "Date", pattern ="", type = "string" },
new ColInfo { id = "", label = "Attendees", pattern ="", type = "number" }
}.ToList(),
rows = new List<DataPointSet>()
};
db.cols.AddRange(listOfValues.Select(p => new ColInfo { id = "", label = p, type = "number" }));
This code which attempts to add some dynamically generated values is not working:
var db = new GoogleGraph {
cols = new ColInfo[] {
new ColInfo { id = "", label = "Date", pattern ="", type = "string" },
new ColInfo { id = "", label = "Attendees", pattern ="", type = "number" },
listOfValues.Select(p => new ColInfo { id = "", label = p, type = "number" })
}.ToList(),
rows = new List<DataPointSet>()
};
How can I correctly implement the above snippet?
You can't pass an IEnumerable<T> to an initializer of T[] like that.
You can do what you want by putting the hard-coded objects in their own collection, then concatenating the dynamic ones:
var db = new GoogleGraph {
cols =
new ColInfo[] {
new ColInfo { id = "", label = "Date", pattern ="", type = "string" },
new ColInfo { id = "", label = "Attendees", pattern ="", type = "number" }
}
.Concat(listOfValues.Select(p =>
new ColInfo { id = "", label = p, type = "number" }))
.ToList(),
rows = new List<DataPointSet>()
};
I have used highchart dll in my web app and created charts in c# code instead of javascript.my problem is shown in below pic (texts move to the left and they aren't in correct place), how can i solve it?
Highcharts charts = new Highcharts("chart");
charts.InitChart(new Chart { DefaultSeriesType = ChartTypes.Pie})
.SetPlotOptions(new PlotOptions
{
Pie = new PlotOptionsPie
{
ShowInLegend = true,
AllowPointSelect = true,
DataLabels = new PlotOptionsPieDataLabels
{
Enabled = true,
Formatter = "function() { return this.point.name +' : '+ this.percentage.toFixed(2)+' %'; }"
}
}
})
.SetTooltip(new Tooltip
{
Enabled = true,
Formatter = #"function(){return '<b>'+this.series.name +'</b> <br/>'+this.point.name + ' : ' + this.percentage.toFixed(2)+' % '; }"
})
.SetLegend(new Legend
{
Align = HorizontalAligns.Center,
VerticalAlign = VerticalAligns.Bottom,
Layout = Layouts.Horizontal,
BorderWidth = 0
});
charts.SetTitle(new Title { Text = chartTitleV + " بر اساس " + chartTitleH.TrimEnd(',').ToString() })
.SetXAxis(new XAxis { Categories = HorCategory })
.SetYAxis(new YAxis { Title = new YAxisTitle { Text = chartTitleV } })
.SetSeries(new[]
{
new Series {Name = chartTitleH.TrimEnd(',').ToString(), Data = new Data(Results )}
});
Try to set useHTML as true in tooltip options.
Do not see the HTML code of the page, but I think that the problem can be in setting the 'dir' property of html elements... As I see the text is written in Arabic language, so the dir="rtl" should be set.
I change direction for div
<div dir="ltr" id="chart2" style="height: 300px"></div>