本文介绍了如何在一行中的split mulitple列中获取单列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我需要单个grivew柱分割和显示muliple柱基于condtion for ex; + ------ + ---------------- + ---------- + | No |代码|数量| + ------ + ---------------- + ---------- + | 1055 | 956,957,958,959 | 10,9,5,4 | i需要 + ------ + ---------------- + ---- ------ + ---------- + | No | code1 |码2 | code3 | code4 | + ------ + ---------------- + ---------- + ---------- + | 1055 | 956 | 957 | 958 | 959 | ---------- + ---------- + ---------- + ---------- + - 我的尝试: im试过这个编码 Grid_CustomColumnDisplayText 属性dev express gridview if(e.Column。 FieldName ==Product|| e.Column.FieldName ==Proddesc) { var Prodvalue = e.Value; string [] procol = Prodvalue.ToString()。Split(';'); for(int i = 0; i< 5; i ++) { string [] qtval = procol [i] .Split('['); string Qtval1 = qtval [1] .Substring(0,qtval [1] .Length - 1); // e.DisplayText = qtyvalue123; } // e.DisplayText = Qtval1 +和+ qtval [i]; // e.DisplayText =test1; } 解决方案 i need single grivew column split and display muliple column based on condtionfor ex;+------+----------------+----------+|No |code | qty |+------+----------------+----------+|1055 |956,957,958,959 | 10,9,5,4 |i need +------+----------------+----------+----------+|No |code1 | code2| code3 | code4 |+------+----------------+----------+----------+|1055 |956 | 957 | 958 | 959 |----------+----------+----------+----------+-What I have tried:i m tried this coding for Grid_CustomColumnDisplayTextproperties dev express gridviewif (e.Column.FieldName == "Product" || e.Column.FieldName == "Proddesc") { var Prodvalue = e.Value; string[] procol = Prodvalue.ToString().Split(';'); for (int i = 0; i < 5; i++) { string[] qtval = procol[i].Split('['); string Qtval1 = qtval[1].Substring(0, qtval[1].Length - 1); // e.DisplayText = qtyvalue123; } // e.DisplayText = Qtval1 + "and " + qtval[i]; // e.DisplayText = "test1"; } 解决方案 这篇关于如何在一行中的split mulitple列中获取单列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-26 19:23