How to sort alphanumeric values in datagrid numerically
Hi all,
I have a datagrid column which contains AlphaNumeric values.Is there a way i can sort these values in a numerical order
eg:
having d1,d11,12,13,d2,d3,d4
d2 should come after d1..
order should be d1,d2,d3,d4,d11,d12,d13
Please help me out..if any have any idea..giving below thw code which is sorting as string
protected function ColumnSortCompare( obj1:Object, obj2:Object ):int
if ( !obj1 && !obj2 )
return 0;
if ( !obj1 )
return 1;
if ( !obj2 )
return -1;
var obj1Data:String = ComplexColumnData( obj1 ).toString();
var obj2Data:String = ComplexColumnData( obj2 ).toString();
if ( obj1Data < obj2Data )
return -1;
if ( obj1Data > obj2Data )
return 1;
return 0;
Thanx in advance
Rajesh
Hi,
Thanks for the reply. Please dont mind if the question is simple,as I am new to flex.
While I am using
return ObjectUtil.stringCompare(obj1[fieldName], obj2[fieldName]);
it is throwing error as, undefined property fieldName.
I am calling as this
<mx:DataGridColumn headerText=""
editable="false"
sortCompareFunction="ColumnSortCompare"
textAlign="left"
dataField="{PORT_NAME}"
width="150"/>
How I can resolve this.Please guide me.
Thanks,
Raj
Similar Messages
-
How to enter a value into datagrid cell in wpf through manually?
Hi,
Here my datagrid rows are in readonly mode here how can i enter the values in to the datagrid cell.(means how can i edit the cell value).i am adding the value to datagrid through programetically, I think for this reason my datagrid rows
are visible in readonly mode. Then how can i edit. Please guide me.
Regards,
BhadramHi Barry,
Thank you for your reply, Now i sending my sample please check it once and suggest me.
MainWindow.xaml.cs
private void Save_Click(object sender, RoutedEventArgs e)
List<CustomerMainViewModel> customer = new List<CustomerMainViewModel>(); customerviewmodel.NameTextField = tbName.Text;
customerviewmodel.AddressTextField = tbAddress.Text;
customerviewmodel.CountryField = countryddl.Text;
customerviewmodel.StateField = stateddl.Text;
customerviewmodel.Product = customerviewmodel.Product1 + "," + customerviewmodel.Product2;
foreach(string str in customerviewmodel.actionCollection)
customerviewmodel.ActionColl.Add(str);
customerviewmodel.actionCollection.Clear();
customer.Add(customerviewmodel);
dataGrid1.Items.Add(customer);
MessageBox.Show("Data Successfully Saved", " MessageBox", MessageBoxButton.OK, MessageBoxImage.Asterisk);
clearValues();
MainWindow.xaml
<DataGrid
Height="144"
HorizontalAlignment="Left"
Margin="79,447,0,0"
Name="dataGrid1"
VerticalAlignment="Top" CanUserAddRows="True"
Width="399" Grid.RowSpan="2" IsReadOnly="False">
<DataGrid.Columns>
<DataGridTextColumn Header="NAME" Binding="{Binding NameTextField,Mode=TwoWay}" Width="Auto" IsReadOnly="False" />
<DataGridTextColumn Header="ADDRESS" Binding="{Binding AddressTextField,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
<DataGridTextColumn Header="GENDER" Binding="{Binding GenderField,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
<DataGridTextColumn Header="COUNTRY" Binding="{Binding CountryField,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
<DataGridTextColumn Header="STATE" Binding="{Binding StateField,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
<DataGridTextColumn Header="PRODUCT" Binding="{Binding Product,Mode=TwoWay}" Width="Auto" IsReadOnly="False"/>
<DataGridTemplateColumn Header="ACTION" MinWidth="140" IsReadOnly="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox x:Name="actionddl" ItemsSource="{Binding ActionColl}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
In the above "xaml" file i am using the attribute "Readonly="False"" but its not effected on my code still my datagrid is in readonly mode, i don't know why it happens.
And I am adding data to my datagrid through "Wpf controls (TextBox,CheckBox,ComboBox and etc...)" while click on "save" button the data added to grid. adding to grid works properly but the entire row is in readonly mode. How can
i solve my problem. -
How to convert alphanumeric ODI variable to numeric
hi,
I am using ODi 11g,
I am having an ODI variable PVV_X of alphanumeric type.
And now I am having a variable PVV_Y in which the refereshing tab has this type of select query :
select sess_beg from snp_session where sess_no = #PVV_X;
Now these two variables are in a package.
My query is that the columne sess_no in the table snp_session is of type number.
How would i comapre the alphanumeric ODI variable value to that of the numeric column value of the database table ?
thanks,
divyaHi,
What is the datatype of "PVV_Y" ?
how PVV_X is getting the value? I mean ru running any refresh query to get this value.
If "PVV_Y" is also a alphanumeric then Oracle will do an implisit datatype conversion.
To prove this , I have done a small POC..
Created a package with
PVV_X -> Declare variable with alphanumeric
PVV_X -> Set with session no
PVV_Y -> Declare varaible with alphanumeric
PVV_Y-> Refresh variable with
select sess_beg from odi_work.snp_session where sess_no=#p_odi_refresh
It worked.
Note: Please make sure the schema is correct for the refresh query.
Thanks
VJ -
How To sort the values of a OVS result table?
Hello,
I'm trying (because i'm new je je), to implement an OVS for an inputfield in my WD app. Now i know for sure that my sophisticated value help do the search of the object and stuff, but i'm wondering if i can "sort" or include the sort method in my result table that is show in my OVS rendered view? Plis if you guys could give me some tutorials or info that would be great
Kisses
MCok that's another idea that i had in mind, built a new window, but my issue was how call that window fron the table cell, just like an OVS? wich UI Element help me with that, no link to action, no button, it most be something like an inputfield, how did you do that?
Kisses
MC -
Sort F4 values in BEX variable screen
Hi ,
Does anyone know how to sort F4 value help in BEX variable selection screen. This query has come up time and again in SDn and there seems to be no proper reply to this. If anyone has worked on this do let me know.
Thanks,
VaishnaviHi Nara,
Kindly have a look at below thread,
Sort the values in Bex query variable screen
Hope this helps.
Regards,
Mani -
How to move the value from a character field to numeric or packed decimal
Hi,
can anyone explain me on how to move the value from a character field to numeric or packed decimal.
Please help me on this. Thanks...
Regards,
Rose.Hi ,
if you use keyword MOVE u may loose the decimal and thoussan separator and if u don't want to loose them just call the FM ..HRCM_STRING_AMOUNT_CONVERT.
i doubt wherther it is HRCM or HCRM just try using *
this will suit ur requirement.
Regards,
KK -
How to Sort Dimension in Pivot Table via Order Column which is changing like Factual values
Hi,
Recently in of our product offerings we got stuck on this following question:
How to Sort Dimension based on the Order Value which Keeps Changing with Factual Values??
We have a data source laid out as (example)
In the above the “Order” columns are changing per
Company/(DimensionA) for DimesnsionB.
Instead what we want is: (But only if we can get the following result without putting the “Order” Column in the “Values” Section.
If there are any configurations that we can make to our power pivot model for the similar data set so that the
DimesnionB in this case can be sorted by the Order column, would be greatly helpful to us.
Sample File:
http://tms.managility.com.au/query_example.xlsx
Thanks
AmolHi Amol,
According to your description, you need to sort dimension members in Pivot Table via order column, and you don't want the order column show on the Pivot table, right?
Based on my research, we can sort the data on the Pivot table based on one of the columns in that table, and we cannot sort the data based on the columns that not existed on the Pivot table. So in your scenario, to achieve your requirement, you can
add the column to pivot table and hide it.
https://support.office.com/en-gb/article/Sort-data-in-a-PivotTable-or-a-PivotChart-report-49efc50a-c8d9-4d34-a254-632794ff1e6e
Regards,
Charlie Liao
TechNet Community Support -
How to sort via multi value parameter in ssrs
I have a parameter with multi values. when the user selects ,he get of options like acount name, first name, last name.
so if user selects firstname , the data has to sort by firstname.
if he selects acount name , the data has to sort by account name.
please help me how to sort the data using parameter with multivalue? in ssrs 2008.
Thank you?Hi Venku,
Based on your description, it seems that you create a parameter with available values and you want to sort the report data based on the parameter value. If the available values are the field names in the report, you can try to open the Tablix properties
dialog box and specify the sort expression on "Sorting" tab as follows:
=Fields(Parameter!parametername.value).value
If the parameter allow multiple values and you want to sort the report data by more than one field, for example, sort the report data by "accountname" and then by "firstname", please add two sort expressions as follows:
=Fields(Parameter!parametername.value(0)).value
=Fields(Parameter!parametername.value(1)).value
If you have any question, please let me know.
Regards,
Fanny Liu
Fanny Liu
TechNet Community Support -
How to get y axis value(in a numeric control) by providing x-axis value using wave graph
Hi,
I'm new here, Sorry if i have selected wrong Location.
I want to get Y-axis value (in a numeric Control) by providing X-axis Value using Wave graph.
i want to do calculations with the obtained value.
i have attached File and Snapshot.Well, you are using the Dynamic Data Type, which I almost never use, but if you convert the data to a WaveForm (using From DDT on the Signal Manipulation Palette, which is a choice when you right-click on the DDT Wire), you should be able to do this. Do you know about how Waveforms are stored? They are a Cluster, with t0 being a TimeStamp for the start of the Waveform, dt being the time step, and Y being the samples. So if you want a point at 0.5 seconds and dt is 0.001, you would pull out the point at Index 499 (offset 0) from the Y array.
Bob Schor -
How to find first non zero value from the numeric value or string?
Hiii, Every body
I have one numeric indicator in which some valuse is coming with the decimal value, lets say 0.00013, now i want to find the first non-zero value from this numeric indicator, then what should i do to do so? i have converted it in the string, but i could not find any method to find first non-zero value from that string or either from the numeric indicator????
Can you please help me, how to do it? i have attached the vi and write all the description inside.
Thanks in Advance,
Nisahnt
Attachments:
Find first nonzero.vi 20 KBJust convert it to an exponential string and take the first character .
Message Edited by altenbach on 05-10-2006 08:00 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
FisrstNonzeroChar.png 3 KB
FindFirstNonzeroCharacter.vi 20 KB -
How do you sort a text field with numeric data in numeric order
We have a text field (varchar2) that has numeric data. When we sort it the items display as
1
2
3
4
5
6
7
8
9
10
*101*
12
Instead of
1
2
3
4
5
6
7
8
9
10
12
101
How can I make it display in numeric order if the field is a varchar2
HowardTo avoid string-to-number conversion:
SQL> with t as (
2 select '1' a from dual union
3 select '2' a from dual union
4 select '3' a from dual union
5 select '4' a from dual union
6 select '5' a from dual union
7 select '6' a from dual union
8 select '7' a from dual union
9 select '8' a from dual union
10 select '9' a from dual union
11 select '10' a from dual union
12 select '101' a from dual union
13 select '12' a from dual)
14 select a from t
15 order by length(a), a;
A
1
2
3
4
5
6
7
8
9
10
12
101
12 rows selected.Max
http://oracleitalia.wordpress.com -
Query to sort a column containing alphanumeric values
Hi,
I have a table whose column contains ALPHANUMERIC values. The column is of type VARCHAR(1).
I tried many queries (using UNION) to fetch records in Alphabets first and Numbers as last
I.e. A-Z should come first and then 0-9 values.
Please do the needful
Regards,
MradulI.e. A-Z should come first and then 0-9 values.Edit: Whoops, I forgot the ascii values for numbers were lower.
WITH t AS
(SELECT '0' c FROM DUAL
UNION
SELECT '9' c FROM DUAL
UNION
SELECT 'A' c FROM DUAL
UNION
SELECT 'B' c FROM DUAL
SELECT c
FROM t
ORDER BY TRANSLATE( UPPER(c)
, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
, TRANSLATE( UPPER(c)
, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
, '0123456789'
C
A
B
0
9Message was edited by:
vg -
How to best indicate a missing value in a numeric indicator
Hello,
I am looking for a possibility to indicate a missing value in a numeric indicator.
There are situations where a data value could not have been measured/read from file/calculated and this should be communicated to the user in a most obvious way.
Personally, I would prefer to have the possibility to display some hyphens "----" to indicate a missing value. I found no way to do so, however, as it would require a string control. (Interestingly, numeric controls can display text, Inf or Nan)
Right now I set the text color to white / black if a value does (not) exist.
I was considering an overlay of numeric and string control but this makes life complicated if the numeric indicator is changed to a normal control with increment/decrement buttons because then one has to also take care of the z-plane position.
Displaying -1 or some other numeric value is not always useful because sometimes all numeric values are allowed/possible.
Are you aware of any other suitable approach?
Thanks,
WolfgangAnother idea I had is you can set the font in the control to strikethrough. Maybe not as good as using -----, but 0.0000 may still get the message across.
You could also try to set your font to Webdings, which I think is standard on all versions of Windows nowadays. The '0' (zero) character kind of looks like a hyphen, so you could set the font to Webdings and the control value to 0 and it could look kind of like what you want. Problem is that you have to get rid of any non-zero character (no +/-, E, or . allowed) and possibly turn on padding to get more than one dash. Here's what one looks like displaying '00000': -
Error loading alphanumeric values
Hi,
I have a data file that has fields with alphanumeric values - alpha and number in a field. Some fields have just alpha values only, and some have both alpha and numeric values. When I tried to load it, it only took the numeric values for those fields with alpha and number, but nothing is load (blank) when the fields have only alpha. I defined the IO as NUMC. There is no conversion specified at the InfoSource.
When I did the Preview from the External tab, I see the alpha fields with '0000' (zeros).
Would someone clarify what is BW doing with this data case?
Thanks,
RTHello Rob,
How r u ?
If u have NUMC as the Datatype it will take only Numeric Values. We can use NUMC for PINCODE, PHONE NUMBERS, etc. i.e. Numeric will not be used for calculation. If u want to load both Alpha & Numeric Values u have to maintain the DataType as CHAR.
If u have the Values with only Alpha or Numbers or both alpha and numeric then they will be loaded.
Also, u may have to maintain the entries in RSKC.
Best Regards....
Sankar Kumar
+91 98403 47141 -
How to delete duplicate value in movement type 541 & 542(alv report)
hi experts,
i have some problem in alv report,
input we can give some movement type for ex(101,102,541,542, etc)
how to delete duplicate value in 541 and 542.
regards
gunasekaran.Try:
Delete adjacent duplicates from ITAB comparing FIELD1, FIELD2.
to do this the ITAB must be Sorted first.!
Maybe you are looking for
-
Crystal Report 10 in Visual Studio 2008
Hello, Is there a formal process to make Visual Studio 2008 work with Crystal Report version 10? Are there specific files that need to be installed? Any problems to watch for. I currently tried to port Visual Studio 2003 solution that had working Cry
-
How to print a particular cell data from .xls file
InputStream inputStream =new FileInputStream("D:\\test.xls"); POIFSFileSystem fileSystem=new POIFSFileSystem (inputStream); HSSFWorkbook workBook = new HSSFWorkbook (fileSystem); HSSFSheet sheet = workBook.getSheetAt (0); Iterator<HSSFRow> rows = she
-
What does it take to run Boot Camp, Fusion or Parallels
I am wondering about upgrading to Leopard to use Boot Camp, Fusion or Parallels. I have found that a significant amount of software that I want to run is not available in a Mac version. The other issue is that many programs I already have for Windows
-
HT201317 how to upload a video
How can I upload a video from my PC?
-
Hi All I have a doubt, please let me know whether this is possible in SAP FICO. During the year end, i have carried forward the balance of a balance sheet a/c to the next year but now i have come across an adjustment for that a/c. What should I do?