Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [mfc] start/stop other process Pin
rahuljin22-Jul-09 7:23
rahuljin22-Jul-09 7:23 
GeneralRe: [mfc] start/stop other process Pin
Rajesh R Subramanian23-Jul-09 7:50
professionalRajesh R Subramanian23-Jul-09 7:50 
GeneralRe: [mfc] start/stop other process Pin
rahuljin23-Jul-09 9:22
rahuljin23-Jul-09 9:22 
GeneralRe: [mfc] start/stop other process Pin
rahuljin22-Jul-09 10:05
rahuljin22-Jul-09 10:05 
GeneralRe: [mfc] start/stop other process Pin
killabyte22-Jul-09 15:18
killabyte22-Jul-09 15:18 
QuestionHow to set CTabCtrl background colour? Pin
risa0922-Jul-09 4:57
risa0922-Jul-09 4:57 
AnswerRe: How to set CTabCtrl background colour? Pin
omjee26-Nov-09 22:20
omjee26-Nov-09 22:20 
QuestionUser control problem Data bind Pin
beesan22-Jul-09 1:36
beesan22-Jul-09 1:36 
Hello All;
i make a user control on c# using ultragrid control the problem is when i take the dll in order to use it in other projects the data doesnt appear, the grid reads the data from the data base

the code of the user control:
the grid name here is ulGrid

<br />
<br />
public partial class GridUserControl : UserControl<br />
    {<br />
        Infragistics.Win.UltraWinGrid.UltraGrid ulGrid = new UltraGrid();<br />
        Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter ulExcel = new UltraGridExcelExporter();<br />
        Infragistics.Win.UltraWinGrid.UltraGridPrintDocument ulPrint = new Infragistics.Win.UltraWinGrid.UltraGridPrintDocument();<br />
        <br />
         <br />
        bool GridRightLeft;<br />
        string HeaderTitle;<br />
        string HeaderRightDetails;<br />
        string HeaderLeftDetails;<br />
<br />
        public GridUserControl()<br />
        {<br />
            InitializeComponent();<br />
            ulItasGrid.ContextMenuStrip = contextMenuStrip1;<br />
        }<br />
<br />
       public delegate void GridEventKeyDown(object sender,KeyEventArgs e);<br />
       public delegate void GridEventKeyUp(object sender, KeyEventArgs e);<br />
       public delegate void GridEventMouseDown(object sender, KeyEventArgs e);<br />
       public delegate void GridEventMouseClick(object sender, KeyEventArgs e);<br />
<br />
<br />
<br />
       <br />
        public bool GridRightToLeft<br />
        {<br />
            set<br />
            {<br />
                GridRightLeft = value;<br />
            }<br />
            get<br />
            {<br />
                return GridRightLeft;<br />
            }<br />
        }<br />
<br />
       <br />
        public string LeftDetails<br />
        {   <br />
            set<br />
            {<br />
                HeaderLeftDetails = value;<br />
            }<br />
            get<br />
            {<br />
                return HeaderLeftDetails;<br />
            }<br />
        }<br />
        public string RightDetails<br />
        {<br />
            set<br />
            {<br />
                HeaderRightDetails = value;<br />
            }<br />
            get<br />
            {<br />
                return HeaderRightDetails;<br />
            }<br />
        }<br />
        DataTable dt = new DataTable();<br />
        public DataTable DataTableSource<br />
        {   set<br />
            {<br />
            //    dt = value;<br />
            //    MessageBox.Show("Befor Set" + dt.Rows.Count.ToString() + " and Columns Count IS : " + value.Columns.Count.ToString());<br />
               ulGrid.DataSource = dt;<br />
            //    ulGrid.DataBind();<br />
            //    MessageBox.Show("After Set" + dt.Rows.Count.ToString() + " and Columns Count IS : " + value.Columns.Count.ToString());<br />
            }<br />
            <br />
                  <br />
            get<br />
            {<br />
                //dt = new DataTable();<br />
                //dt = DataTableSource;<br />
                //MessageBox.Show("Get Set" + dt.Rows.Count.ToString() + " and Columns Count IS : " + dt.Columns.Count.ToString());<br />
                return dt;<br />
            }<br />
            <br />
        }<br />
<br />
        //public object DataSource<br />
        //{<br />
        //    set<br />
        //    {<br />
        //        ulGrid.DataSource = value; <br />
        //    }<br />
        //    get<br />
        //    { return ulGrid.DataSource; }<br />
        //}<br />
<br />
        public object DataSource<br />
        {<br />
            get<br />
            {<br />
                return ulGrid.DataSource;<br />
            }<br />
            set<br />
            {<br />
                // bind the given datasource<br />
                ulGrid.DataSource = value;<br />
<br />
                try<br />
                {<br />
                    ulGrid.DataBind();<br />
                }<br />
                catch (Exception ex)<br />
                {<br />
                    throw new Exception(String.Format("Could not bind data to grid"));<br />
                }<br />
            }<br />
        }<br />
<br />
        public string DataMember<br />
        {<br />
            set { ulGrid.DataMember = value; }<br />
            get { return ulGrid.DataMember; }<br />
           <br />
        }<br />
<br />
<br />
<br />
        public string HeaderReport<br />
        {<br />
            set<br />
            {<br />
                HeaderTitle = value;<br />
            }<br />
            get<br />
            {<br />
                return HeaderTitle;<br />
            }<br />
        }<br />
<br />
        public AutoFitStyle AutoFit<br />
        {<br />
            set<br />
            {<br />
                this.ulItasGrid.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns;<br />
            }<br />
            get<br />
            {<br />
                return this.ulItasGrid.DisplayLayout.AutoFitStyle;<br />
            }<br />
        }<br />
<br />
        public Color Appearance<br />
        {<br />
            set<br />
            { <br />
                     this.ulItasGrid.DisplayLayout.Appearance.BackColor = Color.White;<br />
            }<br />
            get { <br />
                 return  this.ulItasGrid.DisplayLayout.Appearance.BackColor;<br />
            }<br />
         }


and the code of the connection class for testing the grid:

<br />
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Data.SqlClient;<br />
using System.Configuration;<br />
using System.Data;<br />
<br />
<br />
namespace testthegrid<br />
{<br />
    class Connection<br />
    {<br />
        SqlConnection ConnectionStr = new SqlConnection();<br />
<br />
        public Connection()<br />
        {<br />
            ConnectionStr.ConnectionString = "Data Source=.; Initial Catalog=GridExample;Integrated Security=SSPI";<br />
        }<br />
<br />
        public SqlConnection conn<br />
        {<br />
            get<br />
            {<br />
                return this.ConnectionStr;<br />
            }<br />
            set<br />
            {<br />
                this.ConnectionStr = value;<br />
            }<br />
        }<br />
<br />
<br />
        public void OpenConnection()<br />
        {<br />
            if (ConnectionStr.State != ConnectionState.Open)<br />
                ConnectionStr.Open();<br />
        }<br />
<br />
<br />
        public void CloseConnection()<br />
        {<br />
            try<br />
            {<br />
                if (ConnectionStr.State != ConnectionState.Closed)<br />
                    ConnectionStr.Close();<br />
            }<br />
            catch { }<br />
        }<br />
    }<br />
}<br />


and the code for testing the grid is:
<br />
<br />
namespace testthegrid<br />
{<br />
    public partial class Form1 : Form<br />
    {<br />
        private Connection connection = new Connection();<br />
        public Form1()<br />
        {<br />
            InitializeComponent();<br />
            FillGrid();<br />
        }<br />
        private void FillGrid()<br />
        {<br />
            connection.OpenConnection();<br />
            DataTable dt = new DataTable();<br />
            SqlDataAdapter da = new SqlDataAdapter("select * from AccountInfoA", connection.conn);<br />
            da.Fill(dt);<br />
            gridUserControl1.DataTableSource = dt;<br />
            connection.CloseConnection();<br />
<br />
        }<br />


there is no data appears in the grid
thanx a lot
AnswerRe: User control problem Data bind Pin
Cedric Moonen22-Jul-09 2:43
Cedric Moonen22-Jul-09 2:43 
Question[mfc] ip address control Pin
rahuljin22-Jul-09 1:21
rahuljin22-Jul-09 1:21 
AnswerRe: [mfc] ip address control Pin
Adam Roderick J22-Jul-09 2:17
Adam Roderick J22-Jul-09 2:17 
GeneralRe: [mfc] ip address control Pin
rahuljin22-Jul-09 8:01
rahuljin22-Jul-09 8:01 
GeneralRe: [mfc] ip address control Pin
bolivar12322-Jul-09 9:43
bolivar12322-Jul-09 9:43 
GeneralRe: [mfc] ip address control Pin
rahuljin22-Jul-09 10:03
rahuljin22-Jul-09 10:03 
GeneralRe: [mfc] ip address control Pin
bolivar12322-Jul-09 10:20
bolivar12322-Jul-09 10:20 
GeneralRe: [mfc] ip address control Pin
rahuljin22-Jul-09 10:47
rahuljin22-Jul-09 10:47 
GeneralRe: [mfc] ip address control Pin
bolivar12322-Jul-09 11:07
bolivar12322-Jul-09 11:07 
AnswerRe: [mfc] ip address control Pin
Maximilien22-Jul-09 8:17
Maximilien22-Jul-09 8:17 
QuestionDerived classes in MFC Pin
Penfold82121-Jul-09 23:48
Penfold82121-Jul-09 23:48 
AnswerRe: Derived classes in MFC Pin
Code-o-mat22-Jul-09 0:40
Code-o-mat22-Jul-09 0:40 
GeneralRe: Derived classes in MFC Pin
Penfold82122-Jul-09 1:01
Penfold82122-Jul-09 1:01 
GeneralRe: Derived classes in MFC Pin
Code-o-mat22-Jul-09 1:39
Code-o-mat22-Jul-09 1:39 
GeneralRe: Derived classes in MFC Pin
Penfold82122-Jul-09 2:52
Penfold82122-Jul-09 2:52 
GeneralRe: Derived classes in MFC Pin
Code-o-mat22-Jul-09 3:26
Code-o-mat22-Jul-09 3:26 
GeneralRe: Derived classes in MFC Pin
Penfold82122-Jul-09 3:40
Penfold82122-Jul-09 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.