User Profile & Activity

Member
Page
of 3
Posted: October 2, 2012 7:59 AM
Hi to all,
we solve used this function
WebGrid1_OnSynchronizeCell

thanks to all
Posted: September 26, 2012 4:31 AM
Thanks,
the problem is the manage of the data is only on client side.
At the start of the page the data are empty,
When i press the button search the grid was refresh

function searchPrices_Clicked() {
var grid = ISGetObject("WebGridPrices");
grid.Refresh();
}

and in the method WebGridPrices_OnInitializeRow calculte the value

function WebGridPrices_OnInitializeRow(controlId, row) {
//userdefined/edit.aspx?id={380C9D74-F738-DF11-B28F-005056B50AB3}&etc=10011#
var orgname = getQuerystring('orgname', '');
if (orgname != '') {
orgname = '/' + orgname;
}

if (row.Cells.GetNamedItem("discountScaleName") != null) {
row.Cells.GetNamedItem("discountScaleName").Value = [window.location.protocol, '//',
window.location.host, orgname, '/userdefined/edit.aspx?id={',
row.Cells.GetNamedItem("discountScaleId").Value, '}&etc=', etc, '#'].join('');
}
else {
if (row.Cells.GetNamedItem("discountScaleName"))
row.Cells.GetNamedItem("discountScaleName").Value = " ";
}
if (row.Cells.GetNamedItem("price"))
row.Cells.GetNamedItem("price").Value = convertNumberWithRightFormat(parseFloat(row.Cells.GetNamedItem("price").Value));

if (row.Cells.GetNamedItem("priceType")) {
var txt = row.Cells.GetNamedItem("priceType").Value;
if (txt.indexOf('rabatt') == -1) {
if (row.Cells.GetNamedItem("NetAmount"))
row.Cells.GetNamedItem("NetAmount").Value = convertNumberWithRightFormat(parseFloat(row.Cells.GetNamedItem("NetAmount").Value));
}
else {
var quantity = row.Cells.GetNamedItem("minQty").Value;
var priceUnit = row.Cells.GetNamedItem("priceUnit").Value;
var discount = row.Cells.GetNamedItem("fixDiscount1").Value;
var price = parseFloat(convertTextToNumber(row.Cells.GetNamedItem("price").Value));
row.Cells.GetNamedItem("NetAmount").Value = convertNumberWithRightFormat(parseFloat((quantity / (priceUnit * 100)) * (100 * price - discount * price)));
}
}
}

but if i try to get the style.color i have null value because i cannot retrieve the style in the method OnInitializeRow

Posted: September 25, 2012 4:58 AM
Thanks,
i need to setting the color in the client side (in javascript).
My page is a search price for a product and if the price was a special price i need to color in red
the total amount of this price.
You should insert a product and after press the button search and the page should return a list of the prices for this product.
I need to color in red the total amount of some special price.
The data was loading only in client side and i need to change the color after the price search and only if in the price type is Rabbat.

Regards



Posted: August 9, 2012 9:51 AM


I find the solution, i insert this code

SortKeyField = "productnumber"

in the webcombo

<ISWebGrid:WebGridColumn Caption="Product" DataMember="productid" Name="productid" SortKeyField = "productnumber"
Width="190px" EditType="WebComboNET" WebComboID="WebComboProd" InputRequired="True"
InputRequiredErrorText="Specify the Product." TreatMarkupAsLiteralText="True"
ColumnType="Custom">

</ISWebGrid:WebGridColumn>

thanks

Posted: August 9, 2012 9:50 AM

I find the solution, i insert this code

SortKeyField = "productnumber"

in the webcombo

<ISWebGrid:WebGridColumn Caption="Product" DataMember="productid" Name="productid" SortKeyField = "productnumber"
Width="190px" EditType="WebComboNET" WebComboID="WebComboProd" InputRequired="True"
InputRequiredErrorText="Specify the Product." TreatMarkupAsLiteralText="True"
ColumnType="Custom">

</ISWebGrid:WebGridColumn>

thanks
Posted: August 9, 2012 8:53 AM
Hi,
i try to replace but it doesn't work.
The problem is that the cell with the product is a webcombo component, with a product number (ex '0057 00 00 1 ') and a productid (not visible ex "=66666666-6666-6666-6666-00187180828D").
and seem that the sorting was made for the productid ( the key) and not for the product number ( value).
Posted: August 9, 2012 5:44 AM



Thanks,
i try to insert in the server side this
protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{

if (e.Row.Type == RowType.Record)
{
DataRowView a = (DataRowView)e.Row.DataRow;
WebGridCell productIdCell = e.Row.Cells.GetNamedItem("productid");
productIdCell.Column.ColumnType = ISNet.WebUI.WebGrid.ColumnType.Custom;
string productNumber = (string)a["productnumber"];
productIdCell.Text = productNumber.Replace(" ", " ");
...
But it doesn't work.
Is very strange because in other parts of the application the sorting working ( but they don't use the webcombo component).
Is possibile that it depend because the cell of the product is a WebCombo?

This is the definition of the WebCombo in my code

<ISWebCombo:WebCombo ID="WebComboProd" runat="server" AdditionalSearchFields="ProductName, Speedy_CustProdRefDescription"
DataTextField="ProductNumber"
DataValueField="ProductId" MinCharsToRequest="2" Height="20px"
UseDefaultStyle="True" OnInitializeRow="WebComboProd_InitializeRow"
Width="550px" Latency="200"
OnInitializeDataSource="WebComboProd_InitializeDataSource"
OnInitializeLayout="WebComboProd_InitializeLayout" AllowWildCardSearch="True"
DropDownRows="7" >
<Columns>
<ISWebCombo:WebComboColumn BaseFieldName="productnumber" Name="productnumber" HeaderText="Number"
Width="150" />
<ISWebCombo:WebComboColumn BaseFieldName="productname" Name="productname" HeaderText="Name"
Width="250" />
<ISWebCombo:WebComboColumn BaseFieldName="productid" Name="productid" Hidden="true"
RenderOnHidden="true" />
<ISWebCombo:WebComboColumn BaseFieldName="Quantity" Name="Quantity" Hidden="true"
RenderOnHidden="True" />
<ISWebCombo:WebComboColumn BaseFieldName="Speedy_MinimumSellingPrice" Hidden="True"
Name="Speedy_MinimumSellingPrice" RenderOnHidden="True" />
<ISWebCombo:WebComboColumn BaseFieldName="Speedy_MinimumSellingQuantity" Hidden="True"
Name="Speedy_MinimumSellingQuantity" RenderOnHidden="True" />
<ISWebCombo:WebComboColumn BaseFieldName="Speedy_CustProdRefDescription" Name="Speedy_CustProdRefDescription"
HeaderText="Customer reference" Width="150" />
<ISWebCombo:WebComboColumn BaseFieldName="canModifyCustProdRef" DataType="System.Boolean"
Name="canModifyCustProdRef" RenderOnHidden="True" Hidden="True" />
<ISWebCombo:WebComboColumn BaseFieldName="StateCode"
Name="StateCode" RenderOnHidden="True" Hidden="True" />
<ISWebCombo:WebComboColumn BaseFieldName="speedy_referenceallowed" Name="speedy_referenceallowed"
HeaderText="ReferenceAllowed" Hidden="true" RenderOnHidden="True" />
<ISWebCombo:WebComboColumn BaseFieldName="speedy_directdelivery" Name="speedy_directdelivery"
HeaderText="DirectDelivery" Width="120" RenderOnHidden="True" />
<ISWebCombo:WebComboColumn BaseFieldName="statuscodename" Name="statuscodename" HeaderText="StatusCode" Width="120" />
<ISWebCombo:WebComboColumn BaseFieldName="speedy_special" Name="speedy_special"
HeaderText="special" Width="120" Hidden="true" RenderOnHidden="True" />
<ISWebCombo:WebComboColumn BaseFieldName="speedy_prodgroupdes" Name="speedy_prodgroupdes"
HeaderText="speedy_productgroupdes c" Width="120" />
<ISWebCombo:WebComboColumn HeaderText="Url" BaseFieldName="speedy_urltds" Name="speedy_urltds" Hidden="true"
RenderOnHidden="true">
</ISWebCombo:WebComboColumn>
</Columns>
<FlyPostBackSettings PostControlState="False" PostViewState="False" />
<LayoutSettings ComboMode="MultipleColumns" EntryMode="AutoComplete" LoadMoreKeyGesture="DownArrowKey"
>
<ClientSideEvents OnAfterItemSelected="WebComboProd_OnAfterItemSelected"
OnAfterResponseProcess="WebComboProd_OnAfterResponseProcess" />
</LayoutSettings>
</ISWebCombo:WebCombo>

and the WebCombo was insert into WebGrid in this way


<ISWebGrid:WebGridColumn Caption="Product" DataMember="productid" Name="productid"
Width="190px" EditType="WebComboNET" WebComboID="WebComboProd" InputRequired="True"
InputRequiredErrorText="Specify the Product." TreatMarkupAsLiteralText="True"
ColumnType="Custom">

</ISWebGrid:WebGridColumn>


I try to replace the webcombo with a simple WebGridColumn


<ISWebGrid:WebGridColumn Caption="Product Number" DataMember="productnumber" HiddenDataMember="productid" Name="productnumber" ColumnType="Custom" TreatMarkupAsLiteralText="true" Visible="true" Width="100px">
</ISWebGrid:WebGridColumn>


and it works.

So i think it depends of the setting of WebCombo and seems that the sorting was made for the productid ( GUID ) and not for the product number ( text)






Thanks

Posted: August 8, 2012 10:42 AM
Thanks for your answer.
The problem is that the column that we try to sorting is a WebCombo

<ISWebGrid:WebGridColumn Caption="Product" DataMember="productid" Name="productid"
Width="190px" EditType="WebComboNET" WebComboID="WebComboProd" InputRequired="True"
InputRequiredErrorText="Specify the Product." TreatMarkupAsLiteralText="True"
ColumnType="Custom">
</ISWebGrid:WebGridColumn>


All times are GMT -5. The time now is 1:36 AM.
Previous Next