Search Results

Search found 3307 results on 133 pages for 'distributed datasource'.

Page 72/133 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • How to display a two column ListView in Android?

    - by Josemalive
    Hi, I have an android application that shows a grid view that shows: 1 2 3 4 GridView gridview=(GridView)findViewById(R.id.GridView_test); DataBaseHelper dbhelper=new DataBaseHelper(this); ArrayList<String> test=new ArrayList<String>(5); backlinksadapter.add("1"); backlinksadapter.add("2"); backlinksadapter.add("3"); backlinksadapter.add("4"); ArrayAdapter mAdapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, test); gridview.setAdapter(mAdapter); By the moment is working, but i would like to show foreach line of the grid, 2 columns with the values of a 2 dimensional array (something like the GridView in ASP.Net - as datasource -). I would like to show: 1 | Person 1 2 | Person 2 3 | Person 3 4 | Person 4 Any idea?

    Read the article

  • Sync a WinForm with DatagridView

    - by Ruben Trancoso
    I have a Form with a DataGridView which DataSource is a BindingSource to a table. This view will have a single row selection and a button to delete, edit the current selected row in a popup Form and a insert button that will use the same Form as well. My question is how can I sync the pop Form with the current row? I tryied to use the RowStateChanged event to get and store the current selected Row to be used in the Form but I coudnt. After the event I get the row that was selected before. Other thing I dont understand yet in C# how to have a single recordSet and know wich is the current record even if its a new being inserted in a way that once in the Form all data being entered will show up at the same time in the DataGridView.

    Read the article

  • Bind NameValueCollection to GridView?

    - by Xabatcha
    What kind of collection I should use to convert NameValue collection to be bindable to GridView? When doing directly it didn't work. Code in aspx.cs private void BindList(NameValueCollection nvpList) { resultGV.DataSource = list; resultGV.DataBind(); } Code in aspx <asp:GridView ID="resultGV" runat="server" AutoGenerateColumns="False" Width="100%"> <Columns> <asp:BoundField DataField="Key" HeaderText="Key" /> <asp:BoundField DataField="Value" HeaderText="Value" /> </Columns> </asp:GridView> Any tip most welcome. Thanks. X.

    Read the article

  • How to Set a gridview column width when binding to a datatable

    - by Bob Avallone
    I am binding a table to a gridview in asp.net as such grdIssues.DataSource = mdtIssues; grdIssues.DataBind(); The problem is I cannot then control the column width, asp.net seems to decided on it's own what width each column should be. Methods such as grdIssues.Columns[0].ItemStyle.Width = 100; grdIssues.Columns[1].ItemStyle.Width = 100; don't work because the columns are created dynamically. I cannot believe there isn't a way to do this short of manually creating each column and filling each row. Regards, Bob Avallone

    Read the article

  • How to manage a large dataset using Spring MySQL and RowCallbackHandler

    - by rmarimon
    I'm trying to go over each row of a table in MySQL using Spring and a JdbcTemplate. If I'm not mistaken this should be as simple as: JdbcTemplate template = new JdbcTemplate(datasource); template.setFetchSize(1); // template.setFetchSize(Integer.MIN_VALUE) does not work either template.query("SELECT * FROM cdr", new RowCallbackHandler() { public void processRow(ResultSet rs) throws SQLException { System.out.println(rs.getString("src")); } }); I get an OutOfMemoryError because it is trying to read the whole thing. Any ideas?

    Read the article

  • Problem in creating different types of columns in a Winforms gridview

    - by Royson
    My windows form application has a grid view control with filename as a default column. User should create a column of following types Text, Number, Currency, Combo Box, Check Box, Radio Button ,Date time type (should display DateTimePicker control) and Hyper Link type. After that i want to pass all rows to next screen for further processing. We can create a column of these types in a grid view but how can i store it in a data table so that i can pass it to next screen. Or should i create a column in a data table and then assign data table to grid view by gridview.DataSource = dt; but can we create a these types of columns in a data table.

    Read the article

  • iPhone: UITableView Becomes Invisible after Changing the Data it Displays

    - by Alexander Shemshurenko
    Hi I have application with a TabBar that controls several views. In one view, I control connections to different servers. Each server provides a different set of items. I display these items in UITableView on another view. The problem is that the tableview displays OK the first time but if I go back to view number one and change the server, thereby changing the list of items that should be displayed in tableview, the tableview becomes invisible for some reason. If I tap on the screen in the place where it should be, it becomes visible again. I create table view like this UITableView * aTableView = [[UITableView alloc] initWithFrame:CGRectMake(X,Y,Width,Height) style:UITableViewStyleGrouped]; [[self view] addSubview:aTableView]; aTableView.dataSource = self; Ive tried to call reloadData and setNeedsDisplay in viewWillAppear of the UIViewController that hosts this tableview but without success. Any advice? Thanks

    Read the article

  • Using MySQL as data source in Microsoft SQL Server Analysis Services

    - by coldilocks
    Hi, I have installed the latest .net connector (http://www.mysql.com/downloads/connector/net/), I can add MySQL databases as Data Sources, I can even browse through the data from Business Intelligence Studio. The problem is that I CANNOT create a datasource view, or if I do create one without tables, trying to add them after the fact gives me the same error. Specifically it looks like the data source view wizard tries to submit queries against the MySQL database using square brackets/braces, and the query bombs. I get an error message like: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[my_db].[cheatType]' at line 2 So, in summary, has anyone been able to create a data source view using MySQL tables and, if so, can they please show me how this can be done. Thanks for any help!

    Read the article

  • Suppressing a Kendo UI Grid selectable event when clicking a link within a cell

    - by Jensen Ching
    I have a Kendo grid that has links, which I also set to selectable, snippet here: columns: [{ field: 'link', title: 'Link', template: '<a href="${link}">Click Here</a>' }], ... selectable: 'row', change: function(e) { var rowUid = this.select().data('uid'); rowDs = this.dataSource.getByUid(rowUid); console.log('Went (1): ' + rowDs); return false; } When I click on the external link <a>, I also select the row. Is there any way to suppress the selectable event?

    Read the article

  • linq to sql dynamic data modify object before insert and update

    - by Dan Tanner
    I'm using Dynamic Data and LINQ to SQL for some admin pages on a .NET 3.5 web app. All my admin tables a CreatedBy, CreatedDate, UpdatedBy, and UpdatedDate. I'm looking for a way to inject the setting of these properties before the objects are inserted and updated. I've seen an object_inserting hook if you have a linq to sql datasource in the web form, but I'm using dynamic data...is there an easy way to generically set that? And I've also looked at modifying each of the partial classes for my admin objects, but the closest hook I see is to implement the OnValidate method with the Insert action. Any suggestions? TIA.

    Read the article

  • setTimeout in javascript not giving browser 'breathing room'

    - by C Bauer
    Alright, I thought I had this whole setTimeout thing perfect but I seem to be horribly mistaken. I'm using excanvas and javascript to draw a map of my home state, however the drawing procedure chokes the browser. Right now I'm forced to pander to IE6 because I'm in a big organisation, which is probably a large part of the slowness. So what I thought I'd do is build a procedure called distributedDrawPolys (I'm probably using the wrong word there, so don't focus on the word distributed) which basically pops the polygons off of a global array in order to draw 50 of them at a time. This is the method that pushes the polygons on to the global array and runs the setTimeout: for (var x = 0; x < polygon.length; x++) { coordsObject.push(polygon[x]); fifty++; if (fifty > 49) { timeOutID = setTimeout(distributedDrawPolys, 5000); fifty = 0; } } I put an alert at the end of that method, it runs in practically a second. The distributed method looks like: function distributedDrawPolys() { if (coordsObject.length > 0) { for (x = 0; x < 50; x++) { //Only do 50 polygons var polygon = coordsObject.pop(); var coordinate = polygon.selectNodes("Coordinates/point"); var zip = polygon.selectNodes("ZipCode"); var rating = polygon.selectNodes("Score"); if (zip[0].text.indexOf("HH") == -1) { var lastOriginCoord = []; for (var y = 0; y < coordinate.length; y++) { var point = coordinate[y]; latitude = shiftLat(point.getAttribute("lat")); longitude = shiftLong(point.getAttribute("long")); if (y == 0) { lastOriginCoord[0] = point.getAttribute("long"); lastOriginCoord[1] = point.getAttribute("lat"); } if (y == 1) { beginPoly(longitude, latitude); } if (y > 0) { if (translateLongToX(longitude) > 0 && translateLongToX(longitude) < 800 && translateLatToY(latitude) > 0 && translateLatToY(latitude) < 600) { drawPolyPoint(longitude, latitude); } } } y = 0; if (zip[0].text != targetZipCode) { if (rating[0] != null) { if (rating[0].text == "Excellent") { endPoly("rgb(0,153,0)"); } else if (rating[0].text == "Good") { endPoly("rgb(153,204,102)"); } else if (rating[0].text == "Average") { endPoly("rgb(255,255,153)"); } } else { endPoly("rgb(255,255,255)"); } } else { endPoly("rgb(255,0,0)"); } } } } Ugh I don't know if that is properly formatted, I ended up with an extra bracket < So I thought the setTimeout method would allow the site to draw the polygons in groups so the users would be able to interact with the page while it was still drawing. What am I doing wrong here?

    Read the article

  • How to reload a table view in a view controller in iphone?

    - by Warrior
    I am new to iphone development.I have created a table view in a view controller. I want to reload the table view so that i can display the contents which are parsed previously in delegates. More over reloadData does only reload the cells. It doesn't take care of actually updating the underlying datasource. E.g. if i read data from an array in tableView:cellForRowAtIndexPath:, I have to change the array values befor calling reloadData. How can i achieve this. Please help me out.Thanks.

    Read the article

  • Using ObjectBindingDatasource to bind to object exposing Lists, cant drag and drop fields onto repor

    - by SKM
    Hey Guys Ive used the ObjectBindingDatasource to bind to a class Ive called "ReportViewModel" which contains properties such as List Companies {get; set;} List Managers {get; set;} in its constructor Im just calling a method to populate with dummy data Managers = new ReportDataRepository().GetManagers(); Companies = new ReportDataReposiroty().GetCompanies(); ... When i create the new Datasource , it shows the ReportViewModel class with the Lists under it. I expand the Companies object and attempt draging and dropping fields onto the report designer and it works. Though doesnt allow me to drag and drop for any other List. Any guidance would be really appreciated.

    Read the article

  • create new inbox folder and save emails

    - by kasunmit
    i am trying http://www.c-sharpcorner.com/uploadfile/rambab/outlookintegration10282006032802am/outlookintegration.aspx[^] this code for create inbox personal folder and save same mails at the datagrid view (outlook 2007 and vsto 2008) i am able to create inbox folder according to above example but couldn't wire code for save e-mails at that example to save contect they r using following code if (chkVerify.Checked) { OutLook._Application outlookObj = new OutLook.Application(); MyContact cntact = new MyContact(); cntact.CustomProperty = txtProp1.Text.Trim().ToString(); //CREATING CONTACT ITEM OBJECT AND FINDING THE CONTACT ITEM OutLook.ContactItem newContact = (OutLook.ContactItem)FindContactItem(cntact, CustomFolder); //THE VALUES WE CAN GET FROM WEB SERVICES OR DATA BASE OR CLASS. WE HAVE TO ASSIGN THE VALUES //TO OUTLOOK CONTACT ITEM OBJECT . if (newContact != null) { newContact.FirstName = txtFirstName.Text.Trim().ToString(); newContact.LastName = txtLastName.Text.Trim().ToString(); newContact.Email1Address = txtEmail.Text.Trim().ToString(); newContact.Business2TelephoneNumber = txtPhone.Text.Trim().ToString(); newContact.BusinessAddress = txtAddress.Text.Trim().ToString(); if (chkAdd.Checked) { //HERE WE CAN CREATE OUR OWN CUSTOM PROPERTY TO IDENTIFY OUR APPLICATION. if(string.IsNullOrEmpty(txtProp1.Text.Trim().ToString())) { MessageBox.Show("please add value to Your Custom Property"); return; } newContact.UserProperties.Add("myPetName", OutLook.OlUserPropertyType.olText, true, OutLook.OlUserPropertyType.olText); newContact.UserProperties["myPetName"].Value = txtProp1.Text.Trim().ToString(); } newContact.Save(); this.Close(); } else { //IF THE CONTACT DOES NOT EXIST WITH SAME CUSTOM PROPERTY CREATES THE CONTACT. newContact = (OutLook.ContactItem)CustomFolder.Items.Add(OutLook.OlItemType.olContactItem); newContact.FirstName = txtFirstName.Text.Trim().ToString(); newContact.LastName = txtLastName.Text.Trim().ToString(); newContact.Email1Address = txtEmail.Text.Trim().ToString(); newContact.Business2TelephoneNumber = txtPhone.Text.Trim().ToString(); newContact.BusinessAddress = txtAddress.Text.Trim().ToString(); if (chkAdd.Checked) { //HERE WE CAN CREATE OUR OWN CUSTOM PROPERTY TO IDENTIFY OUR APPLICATION. if (string.IsNullOrEmpty(txtProp1.Text.Trim().ToString())) { MessageBox.Show("please add value to Your Custom Property"); return; } newContact.UserProperties.Add("myPetName", OutLook.OlUserPropertyType.olText, true, OutLook.OlUserPropertyType.olText); newContact.UserProperties["myPetName"].Value = txtProp1.Text.Trim().ToString(); } newContact.Save(); this.Close(); } } else { OutLook._Application outlookObj = new OutLook.Application(); OutLook.ContactItem newContact = (OutLook.ContactItem)CustomFolder.Items.Add(OutLook.OlItemType.olContactItem); newContact.FirstName = txtFirstName.Text.Trim().ToString(); newContact.LastName = txtLastName.Text.Trim().ToString(); newContact.Email1Address = txtEmail.Text.Trim().ToString(); newContact.Business2TelephoneNumber = txtPhone.Text.Trim().ToString(); newContact.BusinessAddress = txtAddress.Text.Trim().ToString(); if (chkAdd.Checked) { //HERE WE CAN CREATE OUR OWN CUSTOM PROPERTY TO IDENTIFY OUR APPLICATION. if (string.IsNullOrEmpty(txtProp1.Text.Trim().ToString())) { MessageBox.Show("please add value to Your Custom Property"); return; } newContact.UserProperties.Add("myPetName", OutLook.OlUserPropertyType.olText, true, OutLook.OlUserPropertyType.olText); newContact.UserProperties["myPetName"].Value = txtProp1.Text.Trim().ToString(); } newContact.Save(); this.Close(); } } else { //CREATES THE OUTLOOK CONTACT IN DEFAULT CONTACTS FOLDER. OutLook._Application outlookObj = new OutLook.Application(); OutLook.MAPIFolder fldContacts = (OutLook.MAPIFolder)outlookObj.Session.GetDefaultFolder(OutLook.OlDefaultFolders.olFolderContacts); OutLook.ContactItem newContact = (OutLook.ContactItem)fldContacts.Items.Add(OutLook.OlItemType.olContactItem); //THE VALUES WE CAN GET FROM WEB SERVICES OR DATA BASE OR CLASS. WE HAVE TO ASSIGN THE VALUES //TO OUTLOOK CONTACT ITEM OBJECT . newContact.FirstName = txtFirstName.Text.Trim().ToString(); newContact.LastName = txtLastName.Text.Trim().ToString(); newContact.Email1Address = txtEmail.Text.Trim().ToString(); newContact.Business2TelephoneNumber = txtPhone.Text.Trim().ToString(); newContact.BusinessAddress = txtAddress.Text.Trim().ToString(); newContact.Save(); this.Close(); } } /// /// ENABLING AND DISABLING THE CUSTOM FOLDER AND PROPERY OPTIONS. /// /// /// private void rdoCustom_CheckedChanged(object sender, EventArgs e) { if (rdoCustom.Checked) { txFolder.Enabled = true; chkAdd.Enabled = true; chkVerify.Enabled = true; txtProp1.Enabled = true; } else { txFolder.Enabled = false; chkAdd.Enabled = false; chkVerify.Enabled = false; txtProp1.Enabled = false; } } i don t have idea to convert it to save e-mails in the datagrid view the data gride view i am mentioning here is containing details (sender address, subject etc.) of unread mails and the i i am did was perform some filter for that mails as follows string senderMailAddress = txtMailAddress.Text.ToLower(); List list = (List)dgvUnreadMails.DataSource; List myUnreadMailList; List filteredList = (List)(from ci in list where ci.SenderAddress.StartsWith(senderMailAddress) select ci).ToList(); dgvUnreadMails.DataSource = filteredList; it was done successfully then i need to save those filtered e-mails to that personal inbox folder i created already for that pls give me some help my issue is that how can i assign outlook object just like they assign it to contacts (name, address, e-mail etc.) because in the e-mails we couldn't find it ..

    Read the article

  • unable to update gridview

    - by bhakti
    Please help ,i have added update/edit command button in gridview so to update data in my sql server database but am unable to do it. Data is not updated in database . ======code for onrowupdate======================================== protected void gRowUpdate(object sender, GridViewUpdateEventArgs e) { Books b = null; b = new Books(); DataTable dt=null; GridView g = (GridView)sender; try { dt=new DataTable(); b = new Books(); b.author = Convert.ToString(g.Rows[e.RowIndex].FindControl("Author")); b.bookID = Convert.ToInt32(g.Rows[e.RowIndex].FindControl("BookID")); b.title = Convert.ToString(g.Rows[e.RowIndex].FindControl("Title")); b.price = Convert.ToDouble(g.Rows[e.RowIndex].FindControl("Price")); // b.rec = Convert.ToString(g.Rows[e.RowIndex].FindControl("Date_of_reciept")); b.ed = Convert.ToString(g.Rows[e.RowIndex].FindControl("Edition")); b.bill = Convert.ToString(g.Rows[e.RowIndex].FindControl("Edition")); b.cre_by = Convert.ToString(g.Rows[e.RowIndex].FindControl("Edition")); b.src = Convert.ToString(g.Rows[e.RowIndex].FindControl("Edition")); b.pages = Convert.ToInt32(g.Rows[e.RowIndex].FindControl("Edition")); b.pub = Convert.ToString(g.Rows[e.RowIndex].FindControl("Edition")); b.mod_by = Convert.ToString(g.Rows[e.RowIndex].FindControl("Edition")); b.remark = Convert.ToString(g.Rows[e.RowIndex].FindControl("Edition")); // b.year = Convert.ToString(g.Rows[e.RowIndex].FindControl("Edition")); b.updatebook(b); g.EditIndex = -1; dt = b.GetAllBooks(); g.DataSource = dt; g.DataBind(); } catch (Exception ex) { throw (ex); } finally { b = null; } } ===================My stored procedure for update book able to update database by exec in sqlserver mgmt studio========================== set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[usp_updatebook] @bookid bigint, @author varchar(50), @title varchar(50), @price bigint, @src_equisition varchar(50), @bill_no varchar(50), @publisher varchar(50), @pages bigint, @remark varchar(50), @edition varchar(50), @created_by varchar(50), @modified_by varchar(50) /*@date_of_reciept datetime, @year_of_publication datetime*/ AS declare @modified_on datetime set @modified_on=getdate() UPDATE books SET author=@author, title=@title, price=@price, src_equisition=@src_equisition, bill_no=@bill_no, publisher=@publisher, /*Date_of_reciept=@date_of_reciept,*/ pages=@pages, remark=@remark, edition=@edition, /*Year_of_publication=@year_of_publication,*/ created_by=@created_by, modified_on=@modified_on, modified_by=@modified_by WHERE bookid=@bookid ========================class library function for update==================== public void updatebook(Books b) { DataAccess dbAccess = null; SqlCommand cmd = null; try { dbAccess = new DataAccess(); cmd = dbAccess.GetSQLCommand("usp_updatebook", CommandType.StoredProcedure); cmd.Parameters.Add("@bookid", SqlDbType.VarChar, 50).Value = b.bookID; cmd.Parameters.Add("@author", SqlDbType.VarChar, 50).Value = b.author; cmd.Parameters.Add("@title", SqlDbType.VarChar, 50).Value = b.title; cmd.Parameters.Add("@price", SqlDbType.Money).Value = b.price; cmd.Parameters.Add("@publisher", SqlDbType.VarChar, 50).Value = b.pub; // cmd.Parameters.Add("@year_of_publication", SqlDbType.DateTime).Value =Convert.ToDateTime( b.year); cmd.Parameters.Add("@src_equisition", SqlDbType.VarChar, 50).Value = b.src; cmd.Parameters.Add("@bill_no", SqlDbType.VarChar, 50).Value = b.bill; cmd.Parameters.Add("@remark", SqlDbType.VarChar, 50).Value = b.remark; cmd.Parameters.Add("@pages", SqlDbType.Int).Value = b.pages; cmd.Parameters.Add("@edition", SqlDbType.VarChar, 50).Value = b.ed; // cmd.Parameters.Add("@date_of_reciept", SqlDbType.DateTime).Value = Convert.ToDateTime(b.rec); // cmd.Parameters.Add("@created_on", SqlDbType.DateTime).Value = Convert.ToDateTime(b.cre_on); cmd.Parameters.Add("@created_by", SqlDbType.VarChar, 50).Value = b.cre_by; //cmd.Parameters.Add("@modified_on", SqlDbType.DateTime).Value = Convert.ToDateTime(b.mod_on); cmd.Parameters.Add("@modified_by", SqlDbType.VarChar, 50).Value = b.mod_by; cmd.ExecuteNonQuery(); } catch (Exception ex) { throw (ex); } finally { if (cmd.Connection != null && cmd.Connection.State == ConnectionState.Open) cmd.Connection.Close(); dbAccess = null; cmd = null; } } I have also tried to do update by following way protected void gv1_updating(object sender, GridViewUpdateEventArgs e) { GridView g = (GridView)sender; abc a = new abc(); DataTable dt = new DataTable(); try { a.cd_Id = Convert.ToInt32(g.DataKeys[e.RowIndex].Values[0].ToString()); //TextBox b = (TextBox)g.Rows[e.RowIndex].Cells[0].FindControl("cd_id"); TextBox c = (TextBox)g.Rows[e.RowIndex].Cells[2].FindControl("cd_name"); TextBox d = (TextBox)g.Rows[e.RowIndex].Cells[3].FindControl("version"); TextBox f = (TextBox)g.Rows[e.RowIndex].Cells[4].FindControl("company"); TextBox h = (TextBox)g.Rows[e.RowIndex].Cells[6].FindControl("created_by"); TextBox i = (TextBox)g.Rows[e.RowIndex].Cells[8].FindControl("modified_by"); //a.cd_Id = Convert.ToInt32(b.Text); a.cd_name = c.Text; a.ver = d.Text; a.comp = f.Text; a.cre_by = h.Text; a.mod_by = i.Text; a.updateDigi(a); g.EditIndex = -1; dt = a.GetAllDigi(); g.DataSource = dt; g.DataBind(); } catch(Exception ex) { throw (ex); } finally { dt = null; a = null; g = null; } } =================== but have error of Index out of range exception========= please do reply,thanxs in advance

    Read the article

  • Android simple question

    - by Josemalive
    Hi, I have an android application that shows a grid view that shows: 1 2 3 4 GridView gridview=(GridView)findViewById(R.id.GridView_test); DataBaseHelper dbhelper=new DataBaseHelper(this); ArrayList<String> test=new ArrayList<String>(5); backlinksadapter.add("1"); backlinksadapter.add("2"); backlinksadapter.add("3"); backlinksadapter.add("4"); ArrayAdapter mAdapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, test); gridview.setAdapter(mAdapter); By the moment is working, but i would like to show foreach line of the grid, 2 columns with the values of a 2 dimensional array (something like the GridView in ASP.Net - as datasource -). I would like to show: 1 | Person 1 2 | Person 2 3 | Person 3 4 | Person 4 Any idea? Thanks in advance. Jose.

    Read the article

  • C# Value member property repopulate the control..

    - by karthik
    Hi.. I just wanted to confirm couple of things. I) Code snippet: cmb1.Datasource= dt; cmb1.Valuemember = "value"; Here data population happens 2 time for the control, 1 More time extra,bcoz of value member getting changed after data source assigned. Is it true? II) How can I trace these re population in C#? I just wanted to debug and see and confirm? example please? Thanks Karthik

    Read the article

  • UICollectionViewController nested in a normal UIViewController

    - by patrickS
    I have added a UICollectionView into a normal ViewController (MainViewController), and than created a UICollectionViewController Subclass (CollectionViewController) in the ViewController and connected the UICollectionView outlet with the CollectionViewController object _collectionViewController = [[CollectionViewController alloc] initWithCollectionViewLayout:_collectionView.collectionViewLayout]; _collectionView.dataSource = _collectionViewController; _collectionView.delegate = _collectionViewController; In the CollectionViewController I have setup an simple NSArray object and I show this one. This works as expected. But If I try to access the collectionview from the CollectionViewController via self.collectionview I am not able to access this one. I dont know what I have to do, to also connect the collectionview. I have build a sample ios-app it is available at: https://github.com/patricks/uicollectionview-problem The method - (void)outputSelectedCell in the UICollectionViewController always shows, that there is nothing selected… I hope you understand the problem.

    Read the article

  • Silverlight: Binding to static value

    - by queen3
    I need TextBlock.Text to be retrieved from translation manager, something like <TextBlock Text="{Binding TranslateManager.Translate('word')}" /> I don't want to set DataSource for all text blocks. The only way I found how to do this is to bind to "static" class and use converter: <TextBlock Text="{Binding Value, Source={StaticResource Translation}, Converter={StaticResource Translation}, ConverterParameter=NewProject}" /> And these helper class public class TranslationManager : IValueConverter { public static string Translate(string word) { return translate(word); } // this is dummy for fake static binding public string Value { get; set; } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var name = parameter as string; return TranslationManager.Translate(name, name); } } But, is there a better - shorter - way?

    Read the article

  • What is resource-ref in web.xml used for?

    - by Denise
    Hi everyone, I'm just wondering when/why you would define a resource-ref element in your web.xml file? I would have thought that it would be defined in your web/app server using JNDI and then look up the JNDI reference in your Java code? The resource-ref definition seems a bit redundant to me and I can't think of when it might be useful. Example: <resource-ref> <description>Primary database</description> <res-ref-name>jdbc/primaryDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>CONTAINER</res-auth> </resource-ref> Thanks!

    Read the article

  • How to test a lamda expression var query result is null?

    - by mike
    var query = from emp in dbEmp.Employees join dept in dbEmp.Departments on emp.DeptID equals dept.DeptID where dept.DepartmentName.Contains(this.TextBox1.Text) select new { EmpID = emp.EmpID, EmpName = emp.EmpName, Age = emp.Age, Address = emp.Address, DeptName = dept.DepartmentName }; if (query==null) Label1.Text = "no results match your search"; GridView1.DataSource = query; GridView1.DataBind(); Everything works in the right way, but the label doesn't show the message when query result returns null. The label can show without condition(querry==null). So how to test if a var query result returns nothing? Thanks

    Read the article

  • Adding Item to DataBound Drop Down List

    - by Stephen
    Yes, I have read most of the topics here, but I can't find an answer that works. I have Three drop-down lists. The first is databound to grab distinct experiment names. The user selects, page posts back, and the second drop-down menu displays distinct time points. This is where I need help. I need to add an item to THAT drop-down list whose ID, DataTextField, DataValueField are all TimePt. Seems simple, but I can't get it to work. protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { TimePt.DataSource = TimePTDD; TimePt.DataValueField = "TimePt"; TimePt.DataTextField = "TimePt"; TimePt.DataBind(); TimePt.Items.Insert(0, new ListItem("--Select---", "0")); TimePt.SelectedIndex = 0; } } I'm missing sometthing.

    Read the article

  • nhibernate fatal error

    - by Afif Lamloumi
    i have an error ( System.InvalidCastException: Unable to cast object of type 'AccountProxy' to type 'System.String'.) when i did this code i mapped the tables( Account,AccountString,EventData,...) of the the database opengts ( open source) i have this error when i called a function from EventData.cs IQuery query = session.CreateQuery("FROM Eventdata"); IList pets = query.List(); return pets; the Stack Trace: [InvalidCastException: Impossible d'effectuer un cast d'un objet de type 'AccountProxy' en type 'System.String'.] (Object , Object[] , SetterCallback ) +431 NHibernate.Bytecode.Lightweight.AccessOptimizer.SetPropertyValues(Object target, Object[] values) +20 NHibernate.Tuple.Component.PocoComponentTuplizer.SetPropertyValues(Object component, Object[] values) +49 NHibernate.Type.ComponentType.SetPropertyValues(Object component, Object[] values, EntityMode entityMode) +34 NHibernate.Type.ComponentType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner) +150 NHibernate.Type.ComponentType.NullSafeGet(IDataReader rs, String[] names, ISessionImplementor session, Object owner) +42 NHibernate.Loader.Loader.GetKeyFromResultSet(Int32 i, IEntityPersister persister, Object id, IDataReader rs, ISessionImplementor session) +93 NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, LockMode[] lockModeArray, EntityKey optionalObjectKey, IList hydratedObjects, EntityKey[] keys, Boolean returnProxies) +92 NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +675 NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +129 NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) +116 [GenericADOException: could not execute query [ select eventdata0_.deviceID as deviceID5_, eventdata0_.timestamp as timestamp5_, eventdata0_.statusCode as statusCode5_, eventdata0_.accountID as accountID5_, eventdata0_.latitude as latitude5_, eventdata0_.longitude as longitude5_, eventdata0_.gpsAge as gpsAge5_, eventdata0_.speedKPH as speedKPH5_, eventdata0_.heading as heading5_, eventdata0_.altitude as altitude5_, eventdata0_.transportID as transpo11_5_, eventdata0_.inputMask as inputMask5_, eventdata0_.outputMask as outputMask5_, eventdata0_.address as address5_, eventdata0_.DataSource as DataSource5_, eventdata0_.rawdata as rawdata5_, eventdata0_.distanceKM as distanceKM5_, eventdata0_.odometerKM as odometerKM5_, eventdata0_.geozoneIndex as geozone19_5_, eventdata0_.geozoneID as geozoneID5_, eventdata0_.creationTime as creatio21_5_ from eventdata eventdata0_ ] [SQL: select eventdata0_.deviceID as deviceID5_, eventdata0_.timestamp as timestamp5_, eventdata0_.statusCode as statusCode5_, eventdata0_.accountID as accountID5_, eventdata0_.latitude as latitude5_, eventdata0_.longitude as longitude5_, eventdata0_.gpsAge as gpsAge5_, eventdata0_.speedKPH as speedKPH5_, eventdata0_.heading as heading5_, eventdata0_.altitude as altitude5_, eventdata0_.transportID as transpo11_5_, eventdata0_.inputMask as inputMask5_, eventdata0_.outputMask as outputMask5_, eventdata0_.address as address5_, eventdata0_.DataSource as DataSource5_, eventdata0_.rawdata as rawdata5_, eventdata0_.distanceKM as distanceKM5_, eventdata0_.odometerKM as odometerKM5_, eventdata0_.geozoneIndex as geozone19_5_, eventdata0_.geozoneID as geozoneID5_, eventdata0_.creationTime as creatio21_5_ from eventdata eventdata0_]] NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) +213 NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) +18 NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) +79 NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.List(ISessionImplementor session, QueryParameters queryParameters) +51 NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters) +231 NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results) +369 NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results) +317 NHibernate.Impl.SessionImpl.List(String query, QueryParameters parameters) +282 NHibernate.Impl.QueryImpl.List() +163 DATA1.EventdataExtensions.GetEventdata() in C:\Users\HP\Desktop\our_project\DATA1\Queries\Eventdata.cs:33 MvcApplication7.Controllers.HistoriqueController.Index() in C:\Users\HP\Desktop\our_project\MvcApplication7\Controllers\HistoriqueController.cs:17 lambda_method(Closure , ControllerBase , Object[] ) +62 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263 System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343 System.Web.Mvc.Controller.ExecuteCore() +116 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10 System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21 System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50 System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7 System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841105 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184 Any suggestions? how can correct this error Data entity class (outtake from comment): public class MyClass { public virtual string DeviceID { get; set; } public virtual int Timestamp { get; set; } public virtual string Account { get; set; } public virtual int StatusCode { get; set; } public virtual double Latitude { get; set; } public virtual double Longitude { get; set; } public virtual int GpsAge { get; set; } public virtual double SpeedKPH { get; set; } public virtual double Heading { get; set; } public override bool Equals(object obj) { return true; } public override int GetHashCode() { return 0; } }

    Read the article

  • Browser back button creating problem

    - by user175084
    I have a dynamically generated gridview on page with sorting provided in the code behind also. Now i move from page A to page B using a link, this also works fine. But when i press the browser back button and come back to my page A and again try to sort... page A throws an exception... is there a way to program this back button like we program a button normally.. Thanks ` Cannot find column machinename. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IndexOutOfRangeException: Cannot find column machinename. Source Error: Line 519: Line 520: //Sort the data. Line 521: dt.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression); Line 522: GridView1.DataSource = Session["TaskTable"]; Line 523: GridView1.DataBind();`

    Read the article

  • winForms Booking Class Help

    - by cameron
    Hi, I am using C# Windows Forms in visual studio with different classes performing different functions in my program. I have a "Program" main class with the following information: static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } and a Screen class with the following information class Screen { public List<Show> shows { get; private set; } public int ScreenNumber { get; private set; } public Screen(int screenNumber, params Show[] schedule) { this.ScreenNumber = screenNumber; this.shows = schedule.ToList<Show>(); } } and a Seat class with the following information public class Seat { private string name; public bool IsAvailable { get; set; } public decimal Price { get; private set; } public int Number { get; private set; } public Seat(bool isAvailable, int number) { this.IsAvailable = isAvailable; this.name = String.Format("Seat {0}",number); this.Price = 7.50m; this.Number = number; } public override string ToString() { return this.name; } } and finally a Show class with the following information public class Show { private List<Seat> seats = new List<Seat>(); public string Title { get; private set; } public string Time { get; private set; } public int ScreenNumber { get; private set; } public List<Seat> Seats { get { return this.seats; } } public Show(string title, DateTime time, int screenNumber, int numberOfSeats) { this.Title = title; this.Time = time.ToShortTimeString(); this.ScreenNumber = screenNumber; this.initSeats(numberOfSeats); } private void initSeats(int numberOfSeats) { for (int i = 0; i < numberOfSeats; i++) this.seats.Add(new Seat(true, i + 1)); } }` these all feed into two different winForms to create a booking system for shows. therefore i need to collate the data given in program and output it into a txt file. any help will be much appreciated NOTE: the code for FORM1 which allows the user to select which show they want is: namespace CindysSeats { public partial class Form1 : Form { private Cinema cinema = new Cinema(); //booked show could be added to booking object when you create it so that it is easily writable to the external file private Show selectedShow; public Form1() { InitializeComponent(); this.showList_dg.DataSource = this.cinema.GetShowList(); } private void showList_dg_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { Show selectedShow = this.selectedShow = this.cinema.GetShowList()[e.RowIndex]; this.showTitle_lbl.Text = selectedShow.Title; this.showTime_lbl.Text = selectedShow.Time; this.showScreen_lbl.Text = selectedShow.ScreenNumber.ToString(); } private void confirmShow_btn_Click(object sender, EventArgs e) { if (this.selectedShow == null) return; Form2 seats = new Form2(this.selectedShow); seats.Show(); } And the code for FORM2 which is where the user selects their seats they want is: namespace CindysSeats { public partial class Form2 : Form { //booked seats could be added to booking object when you create it so that it is easily writable to the external file private List<Seat> bookedSeats = new List<Seat>(); private Show selectedShow; public Form2(Show selectedShow) { InitializeComponent(); this.selectedShow = selectedShow; this.showSeats_dg.DataSource = this.selectedShow.Seats; } private void showSeats_dg_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { Seat selectedSeat = this.selectedShow.Seats[e.RowIndex]; if(this.bookedSeats.Contains(selectedSeat)) return; if(!selectedSeat.IsAvailable) return; this.bookedSeats.Add(selectedSeat); this.bookedSeats_lv.Items.Add(selectedSeat.ToString() + " " + selectedSeat.Price.ToString()+"\n"); this.bookedSeats_lv.Invalidate(); } private void bookSeats_btn_Click(object sender, EventArgs e) { } } thank you for helping

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >