# Multiple ColumnName for RegexStyle

**URL:** <https://community.thinkgeo.com/t/multiple-columnname-for-regexstyle/2390>\
**Category:** WinForms\
**Created:** [May 6, 2014, 12:24pm UTC](https://community.thinkgeo.com/t/multiple-columnname-for-regexstyle/2390 "2014-05-06T12:24:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ariestya](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@Ariestya](https://community.thinkgeo.com/u/Ariestya)\
**Post date:** [May 6, 2014, 12:24pm UTC](https://community.thinkgeo.com/t/multiple-columnname-for-regexstyle/2390/1 "2014-05-06T12:24:09Z")

</div>

Hi,  
  
  
  
Just&nbsp;straight&nbsp;to&nbsp;my&nbsp;problem,&nbsp;is&nbsp;there&nbsp;any&nbsp;way&nbsp;to&nbsp;set&nbsp;ThinkGeo.MapSuite.Core.RegexStyle.ColumnName&nbsp;property&nbsp;to&nbsp;multiple&nbsp;columns?&nbsp;I&nbsp;notice&nbsp;there’s&nbsp;a&nbsp;RequiredColumnNames&nbsp;property&nbsp;(inherited&nbsp;from&nbsp;Style),&nbsp;but&nbsp;it&nbsp;has&nbsp;only&nbsp;a&nbsp;getter,&nbsp;but&nbsp;not&nbsp;also&nbsp;a&nbsp;setter.&nbsp;I&nbsp;want&nbsp;to&nbsp;create&nbsp;filters&nbsp;that&nbsp;are&nbsp;based&nbsp;on&nbsp;multiple&nbsp;(at&nbsp;least&nbsp;2)&nbsp;columns.&nbsp;How&nbsp;I&nbsp;can&nbsp;accomplish&nbsp;this?  
  
  
  
And&nbsp;if&nbsp;that&nbsp;is&nbsp;possible,&nbsp;how&nbsp;to&nbsp;determine&nbsp;which&nbsp;filter&nbsp;that&nbsp;I&nbsp;will&nbsp;be&nbsp;used?&nbsp;RegexItems&nbsp;can&nbsp;only&nbsp;be&nbsp;used&nbsp;on&nbsp;that&nbsp;ColumnName,&nbsp;if&nbsp;there&nbsp;are&nbsp;multiple&nbsp;columns&nbsp;to&nbsp;be&nbsp;filtered,&nbsp;how&nbsp;to&nbsp;apply&nbsp;a&nbsp;regex&nbsp;to&nbsp;each&nbsp;column?

---

<div class="post-metadata">

**Author:** ![Troy](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@Troy](https://community.thinkgeo.com/u/Troy)\
**Post date:** [May 8, 2014, 2:34am UTC](https://community.thinkgeo.com/t/multiple-columnname-for-regexstyle/2390/2 "2014-05-08T02:34:58Z")

</div>

Hi&nbsp;Ariestya,  
  
  
  
Currently,&nbsp;the&nbsp;RegexStyle&nbsp;is&nbsp;not&nbsp;support&nbsp;the&nbsp;multi&nbsp;columns,&nbsp;but&nbsp;I&nbsp;think&nbsp;there&nbsp;is&nbsp;a&nbsp;possible&nbsp;to&nbsp;define&nbsp;a&nbsp;customRegexStyle&nbsp;to&nbsp;support&nbsp;it.&nbsp;Here&nbsp;I&nbsp;attached&nbsp;a&nbsp;customRegexStyle&nbsp;and&nbsp;you&nbsp;can&nbsp;do&nbsp;some&nbsp;modifications&nbsp;on&nbsp;the&nbsp;DrawCore&nbsp;method&nbsp;to&nbsp;implement&nbsp;that.  
  
  
  
Beside&nbsp;the&nbsp;above&nbsp;way,&nbsp;here&nbsp;is&nbsp;an&nbsp;option&nbsp;but&nbsp;not&nbsp;sure&nbsp;if&nbsp;it&nbsp;is&nbsp;fit&nbsp;for&nbsp;you.&nbsp;We&nbsp;can&nbsp;insert&nbsp;some&nbsp;value&nbsp;style&nbsp;into&nbsp;one&nbsp;RegexStyle&nbsp;to&nbsp;use&nbsp;the&nbsp;multiColumn&nbsp;but&nbsp;the&nbsp;value&nbsp;style&nbsp;is&nbsp;not&nbsp;support&nbsp;the&nbsp;Regular&nbsp;match&nbsp;but&nbsp;full&nbsp;match.&nbsp;In&nbsp;case&nbsp;you&nbsp;need&nbsp;it,&nbsp;I&nbsp;attached&nbsp;some&nbsp;codes&nbsp;here:

> `RegexStyle regexStyle1 = ``new`&nbsp;`RegexStyle();`  
> `regexStyle1.ColumnName = ``"Field1"``;`  
> &nbsp;  
> `ValueStyle valueStyle = ``new`&nbsp;`ValueStyle();`  
> `valueStyle.ColumnName = ``"Field2"``;`  
> `valueStyle.ValueItems.Add(``new`&nbsp;`ValueItem(``"value1"``,``new`&nbsp;`AreaStyle(``new`&nbsp;`GeoSolidBrush(GeoColor.StandardColors.Red))));`  
> &nbsp;  
> `RegexItem regexItem1 = ``new`&nbsp;`RegexItem();`  
> `regexItem1.RegularExpression = ``"G."``;`  
> `regexItem1.CustomStyles.Add(valueStyle);`  
> `regexStyle1.RegexItems.Add(regexItem1);`

  
Btw,&nbsp;the&nbsp;RequiredColumnNames&nbsp;property&nbsp;is&nbsp;for&nbsp;the&nbsp;styles&nbsp;defined&nbsp;in&nbsp;the&nbsp;RegexItem&nbsp;and&nbsp;it&nbsp;is&nbsp;not&nbsp;for&nbsp;RegexStyle&nbsp;columns  
Hope&nbsp;it&nbsp;helps.  
  
  
  
Thanks,  
Troy  
  
[CustomRegexStyle.txt](https://community.thinkgeo.com/uploads/default/original/2X/d/d740825660321c86b78152ed4a2e5ef0fe4f371d.txt) (2.92 KB)

---

<div class="post-metadata">

**Author:** ![Ariestya](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@Ariestya](https://community.thinkgeo.com/u/Ariestya)\
**Post date:** [May 9, 2014, 1:26am UTC](https://community.thinkgeo.com/t/multiple-columnname-for-regexstyle/2390/3 "2014-05-09T01:26:33Z")

</div>

Thank&nbsp;you&nbsp;for&nbsp;the&nbsp;help.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;ended&nbsp;up&nbsp;using&nbsp;2&nbsp;RegexStyle,&nbsp;one&nbsp;apply&nbsp;color&nbsp;to&nbsp;features&nbsp;according&nbsp;to&nbsp;matches&nbsp;value&nbsp;from&nbsp;first&nbsp;column,&nbsp;the&nbsp;other&nbsp;one&nbsp;overlap&nbsp;features&nbsp;that&nbsp;their&nbsp;value&nbsp;don’t&nbsp;match&nbsp;(like&nbsp;^&nbsp;in&nbsp;regex)&nbsp;for&nbsp;the&nbsp;2nd&nbsp;column,&nbsp;but&nbsp;your&nbsp;2nd&nbsp;solution&nbsp;that&nbsp;uses&nbsp;ValueStyle&nbsp;also&nbsp;works&nbsp;well.&nbsp;Thank&nbsp;you.

---

<div class="post-metadata">

**Author:** ![Troy](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@Troy](https://community.thinkgeo.com/u/Troy)\
**Post date:** [May 11, 2014, 8:26pm UTC](https://community.thinkgeo.com/t/multiple-columnname-for-regexstyle/2390/4 "2014-05-11T20:26:12Z")

</div>

Ariestya,&nbsp;  
&nbsp;&nbsp;  
&nbsp;So&nbsp;good&nbsp;to&nbsp;hear&nbsp;it&nbsp;works&nbsp;for&nbsp;you.&nbsp;  
&nbsp;Any&nbsp;questions,&nbsp;don’t&nbsp;hesitate&nbsp;to&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;Johnny
