您好,可以再导入之后通过代码设置dataBarRule 的AxisPosition 属性解决您的问题
- void testClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
- {
- TestSheet.OpenExcel(e.Result);
- TestSheet.Loaded += TestSheet_Loaded;
- }
- private void TestSheet_Loaded(object sender, RoutedEventArgs e)
- {
- var CondF = TestSheet.ActiveSheet.ConditionalFormats;
- if (CondF.RuleCount > 0)
- {
- for(int i = 0; i < CondF.RuleCount; i++)
- {
- if (CondF[i] is GrapeCity.Windows.SpreadSheet.Data.DataBarRule)
- {
- GrapeCity.Windows.SpreadSheet.Data.DataBarRule rule = CondF[i] as GrapeCity.Windows.SpreadSheet.Data.DataBarRule;
- rule.AxisPosition = GrapeCity.Windows.SpreadSheet.Data.DataBarAxisPosition.None;
- break;
- }
- }
-
- }
- }
复制代码 |