www.pudn.com > PrintDataGridViewDemo.rar > PrintOptions.cs, change:2013-07-08,size:1670b


using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Text; 
using System.Windows.Forms; 
 
namespace ColorDemo 
{ 
    public partial class PrintOptions : Form 
    { 
        public PrintOptions() 
        { 
            InitializeComponent(); 
        } 
        public PrintOptions(List<string> availableFields) 
        { 
            InitializeComponent(); 
 
            foreach (string field in availableFields) 
                     chklst.Items.Add(field, true); 
        } 
 
        private void PrintOtions_Load(object sender, EventArgs e) 
        { 
            rdoAllRows.Checked = true; 
            chkFitToPageWidth.Checked = true;  
        } 
 
        private void btnOK_Click(object sender, EventArgs e) 
        { 
            this.DialogResult = DialogResult.OK; 
            this.Close(); 
 
        } 
 
        private void btnCancel_Click(object sender, EventArgs e) 
        { 
            this.DialogResult = DialogResult.Cancel; 
            this.Close(); 
        } 
 
        public List<string> GetSelectedColumns() 
        { 
            List<string> lst = new List<string>(); 
            foreach (object item in chklst.CheckedItems) 
                    lst.Add(item.ToString()); 
            return lst; 
        } 
 
        public string PrintTitle 
        { 
            get { return txtTitle.Text; } 
        } 
 
        public bool PrintAllRows 
        { 
            get { return rdoAllRows.Checked; } 
        } 
 
        public bool FitToPageWidth 
        { 
            get { return chkFitToPageWidth.Checked; } 
        } 
 
    } 
}