Search Results

Search found 4628 results on 186 pages for 'gridview editing'.

Page 3/186 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • ASP.NET C# Show buttons in gridview records

    - by vamyip
    Hello, I want to add a column to a gridview which contains button control. I am using ID(integer and primary key) as the 1st column of Gridview. What I want is that when a user clicks the button on any given row of gridview, I want to able to determine the ID of the row to which the clicked button belongs Vam Yip

    Read the article

  • Overwrite values when using gridview Edit?

    - by sah302
    I am using a GridView which is bound to a LinqDataSource and using the automatic edit and delete buttons. However, I don't want the user to edit two of the columns manually, but done automatically. Specifically username who last updated the entry, and the date it was updated. The gridview only contains 3 columns: Name, Date modified, last updated by. Right now when the user clicks the edit button they can only edit the name column (other two set to read-only). Upon clicking the update button, I want the other 2 fields to update as well based on some extra code. I thought this was done in the code behind within the event rowUpdating, but it doesn't seem to work. My gridview: <asp:GridView ID="gvNewsSources" runat="server" AutoGenerateColumns="False" DataSourceID="ldsNewsSource" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" CellPadding="4" ForeColor="#333333" GridLines="None" DataKeyNames="Id"> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <Columns> <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /> <asp:BoundField DataField="LastUpdatedBy" HeaderText="Last Updated By" SortExpression="LastUpdatedBy" ReadOnly="True" /> <asp:BoundField DataField="DatedModified" HeaderText="Dated Modified" SortExpression="DatedModified" ReadOnly="True" /> </Columns> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> </asp:GridView> My code behind: Partial Class _Default Inherits System.Web.UI.Page Protected Sub gvNewsSources_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles gvNewsSources.RowUpdating e.NewValues("LastUpdatedBy") = GetUser.GetUserName e.NewValues("DateModified") = Date.Now() lblOutput.Text = e.NewValues("DateModified").ToString() End Sub End Class Yet when I run through this, I get no errors, but the values aren't being updated in the database or in the gridview. I ran through debug mode and the new values dictionary starts at 1 and ends up being 3 by the end of the rowUpdating event and the value is being set (tested by output the newValue of Datemodified), but it isn't saving. What am I doing wrong?

    Read the article

  • Need html code of GridView within C# code.

    - by IrfanRaza
    Hello friends, I am having an aspx page with a user control in it. The usercontrol contains the GridView. At some place within this usercontrol i need html code of GridView. Can anybody provide help on how i can get html code of GridView. Thanks for sharing your time.

    Read the article

  • Create a ASP.NET Generic gridview

    - by harold-sota
    I wont to create a User Control based in gridview that have the edit add delete incorporate, the problem is these: In the admin part of my web site i have to repeat the same action for view add delete update the data for different datasource. I wont to create a generic gridview that have incorporate these action. The gridview can take a xml file for configure him self dependently of the request for desplay the data. Any ideas how i can do it?

    Read the article

  • Need to read gridview height after databind

    - by Bob Jones
    I have two panels on the same page, side by side. On contains a gridview. I want to determine the height of the gridview after databinding and set the height of the other panel correspondingly, but when I try to read the height of the gridview it comes back as 0. How do I get it's height, preferably in PX?

    Read the article

  • Create a ASP.NET smart gridview

    - by harold-sota
    I wont to create a User Control based in gridview that have the edit add delete incorporate, the problem is these: In the admin part of my web site i have to repeat the same action for view add delete update the data for different datasource. I wont to create a generic gridview that have incorporate these action. The gridview can take a xml file for configure him self dependently of the request for desplay the data. Any ideas how i can do it?

    Read the article

  • ASP.NET GridView - how to enable validation declaratively

    - by Joe
    It it possible to enable validation in an ASP.NET GridView purely declaratively? What I've tried: A GridView bound to an ObjectDataSource with SelectMethod and UpdateMethod defined The GridView contains some ReadOnly BoundField columns and a TemplateField whose EditTemplate contains a TextBox and a RegularExpressionValidator that only allows numeric input in the TextBox. The GridView also contains a CommandField with ShowEditButton=true and CausesValidation=true. If I click on Edit, enter an invalid value, then click on Save, there is a PostBack, and an exception is thrown in the server (Input string was not in a correct format). I can of course avoid this by adding validation code to the RowUpdating event handler on the server (see below), but is there any declarative way to force the validation to be done without adding this code? protected void MyGridView_RowUpdating(object sender, GridViewUpdateEventArgs e) { Page.Validate("MyValidationGroup"); if (!Page.IsValid) { e.Cancel = true; } }

    Read the article

  • GridView: Control Designer

    - by pipelinecache
    Hi, I have a question regarding the GridView and the Control Designer of it. I've made a composite control inherited of the GridView. I would like to make some new created BoundField controls available in the designer of the GridView control? So that I can select the custom BoundField control from the Available fields list. Anyone got a clue about this one?

    Read the article

  • What is the easiest video editing program to use on Windows

    - by Rob Allen
    I am looking for suggestions for video editing programs like iMovie, which are dead simple to use. We just need basic editing and titling features for making videos of our kids slightly more watchable. Nothing too fancy. The major requirement is that it needs to be extremely easy to use even without prior editor experience. We're running Windows XP on some machines and Vista the rest. Free is preferred however ease-of use trumps price.

    Read the article

  • Even if GridView.DataKeyNames is set, Gridview.DataKeys[] is still empty

    - by JustTryingToLearn
    hi GridView.DataKeynames stores the names of the primary key fields for the items displayed in a GridView control. 1) Even though I’ve set DataKeyNames, GridView still doesn’t store record’s primary key value(s) in DataKey object: protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e) { Label2.Text = GridView2.DataKeys[0].Value.ToString();//exception } Why not? 2) I assume when DataKeyNames is set, DataKey object stores both original and new values of a primary key ( assuming we issued an update command ) and when the update is finished, DataKey object discards the original value(s)? Thank you

    Read the article

  • onCommand on button not firing inside gridView??

    - by sah302
    This is really driving me crazy. I've got a button inside a gridview to remove that item from the gridview (its datasource is a list). I've got the list being saved to session anytime a change is being made to it, and on page_load check if that session variable is empty, if not, then set that list to bind to the gridview. Code Behind: Public accomplishmentTypeDao As New AccomplishmentTypeDao() Public accomplishmentDao As New AccomplishmentDao() Public userDao As New UserDao() Public facultyDictionary As New Dictionary(Of Guid, String) Public facultyList As New List(Of User) Public associatedFaculty As New List(Of User) Public facultyId As New Guid Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'If Not Session("associatedFaculty") Is Nothing Then' ' Dim associatedFacultyArray As User() = DirectCast(Session("associatedFaculty"), User())' ' associatedFaculty = associatedFacultyArray.ToList()' 'End If' Page.Title = "Add a New Faculty Accomplishment" ddlAccomplishmentType.DataSource = accomplishmentTypeDao.getEntireTable() ddlAccomplishmentType.DataTextField = "Name" ddlAccomplishmentType.DataValueField = "Id" ddlAccomplishmentType.DataBind() facultyList = userDao.getListOfUsersByUserGroupName("Faculty") For Each faculty As User In facultyList facultyDictionary.Add(faculty.Id, faculty.LastName & ", " & faculty.FirstName) Next If Not Page.IsPostBack Then ddlFacultyList.DataSource = facultyDictionary ddlFacultyList.DataTextField = "Value" ddlFacultyList.DataValueField = "Key" ddlFacultyList.DataBind() End If gvAssociatedUsers.DataSource = associatedFaculty gvAssociatedUsers.DataBind() End Sub Protected Sub deleteUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) facultyId = New Guid(e.CommandArgument.ToString()) associatedFaculty.Remove(associatedFaculty.Find(Function(user) user.Id = facultyId)) Session("associatedFaculty") = associatedFaculty.ToArray() gvAssociatedUsers.DataBind() upAssociatedFaculty.Update() End Sub Protected Sub btnAddUser_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddUser.Click facultyId = New Guid(ddlFacultyList.SelectedValue) associatedFaculty.Add(facultyList.Find(Function(user) user.Id = facultyId)) Session.Add("associatedFaculty", associatedFaculty.ToArray()) gvAssociatedUsers.DataBind() upAssociatedFaculty.Update() End Sub Protected Sub Delete(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) End Sub End Class Markup: <asp:UpdatePanel ID="upAssociatedFaculty" runat="server" UpdateMode="Conditional"> <ContentTemplate> <p><b>Created By:</b> <asp:Label ID="lblCreatedBy" runat="server"></asp:Label></p> <p><b>Accomplishment Type: </b><asp:DropDownList ID="ddlAccomplishmentType" runat="server"></asp:DropDownList></p> <p><b>Accomplishment Applies To: </b><asp:DropDownList ID="ddlFacultyList" runat="server"></asp:DropDownList> &nbsp;<asp:Button ID="btnAddUser" runat="server" Text="Add Faculty" OnClientClick="incrementCounter();" /></p> <p> <asp:GridView ID="gvAssociatedUsers" runat="server" AutoGenerateColumns="false" GridLines="None" ShowHeader="false"> <Columns> <asp:BoundField DataField="Id" HeaderText="Id" Visible="False" /> <asp:TemplateField ShowHeader="False"> <ItemTemplate> <span style="margin-left: 15px;"> <p><%#Eval("LastName")%>, <%#Eval("FirstName")%> <asp:Button ID="btnUnassignUser" runat="server" CausesValidation="false" CommandArgument='<%# Eval("Id") %>' CommandName="Delete" OnCommand="deleteUser" Text='Remove' /></p> </span> </ItemTemplate> </asp:TemplateField> </Columns> <EmptyDataTemplate> <em>There are currently no faculty associated with this accomplishment.</em> </EmptyDataTemplate> </asp:GridView> </p> </ContentTemplate> </asp:UpdatePanel> Now here is the crazy part I am simply boggled by, if I uncomment the If Not Session... block of page_load, then deleteUser will never fire when btnUnassignUser is clicked. If I keep it commented out...it fires no problem, but then of course my list can never have more than one item since I am not loading the saved list from session into the gridview but just a fresh one. But the button click is being registered, because page_load is being stepped through again when I am viewing in debug mode, just deleteUser never fires. Why is this happening?? And how can I fix it??

    Read the article

  • How to refresh a GridView?

    - by Daniel
    Hello everyone, I have a GridView which is pretty similar to the Google tutorial, except that I want to add the ImageViews on runtime (via a subactivity). The results are okay, but the layout of the View is messed up: The GridView doesn't fill the content of its parent, what do I have to do to design it properly? Here the code of adding the children: public void initializeWorkbench(GridView gv, Vector<String> items) { Prototype.workbench.setDimension(screenWidth, divider.height()+workbenchArea.height()); Prototype.workbench.activateWorkbench(); // this measures the workbench correctly Log.d(Prototype.TAG, "workbench width: "+Prototype.workbench.getMeasuredWidth()); // 320 Log.d(Prototype.TAG, "workbench height: "+Prototype.workbench.getMeasuredHeight()); // 30 ImageAdapter imgAdapter = new ImageAdapter(this.getContext(), items); gv.setAdapter(imgAdapter); gv.measure(screenWidth, screenHeight); gv.requestLayout(); gv.forceLayout(); Log.d(Prototype.TAG, "gv width: "+gv.getMeasuredWidth()); // 22 Log.d(Prototype.TAG, "gv height: "+gv.getMeasuredHeight()); // 119 Prototype.workbench.setDimension(screenWidth, divider.height()+workbenchArea.height()); } } activateWorkbench, setDimension and measure in the workbench (LinearLayout above the GridView): public void activateWorkbench() { if(this.equals(Prototype.workbench)) { this.setOrientation(VERTICAL); show = true; measure(); } } public void setDimension(int w, int h) { width = w; height = h; this.setLayoutParams(new LinearLayout.LayoutParams(width, height)); this.invalidate(); } private void measure() { if (this.getOrientation() == LinearLayout.VERTICAL) { int h = 0; int w = 0; this.measureChildren(0, 0); for (int i = 0; i < this.getChildCount(); i++) { View v = this.getChildAt(i); h += v.getMeasuredHeight(); w = (w < v.getMeasuredWidth()) ? v.getMeasuredWidth() : w; } if (this.equals(Prototype.tagarea)) height = (h < height) ? height : h; if (this.equals(Prototype.tagarea)) width = (w < width) ? width : w; } this.setMeasuredDimension(width, height); } The ImageAdapter constructor: public ImageAdapter(Context c, Vector<String> items) { mContext = c; boolean mExternalStorageAvailable = false; boolean mExternalStorageWriteable = false; String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { // We can read and write the media mExternalStorageAvailable = mExternalStorageWriteable = true; } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { // We can only read the media mExternalStorageAvailable = true; mExternalStorageWriteable = false; } else { // Something else is wrong. It may be one of many other states, but // all we need // to know is we can neither read nor write mExternalStorageAvailable = mExternalStorageWriteable = false; } if (mExternalStorageAvailable && mExternalStorageWriteable) { for (String item : items) { File f = new File(item); if (f.exists()) { try { FileInputStream fis = new FileInputStream(f); Bitmap b = BitmapFactory.decodeStream(fis); bitmaps.add(b); files.add(f); } catch (FileNotFoundException e) { Log.e(Prototype.TAG, "", e); } } } } } And the xml layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:gravity="bottom" android:paddingLeft="0px" android:paddingTop="0px" android:paddingRight="0px"> <com.unimelb.pt3.ui.TransparentPanel android:id="@+id/workbench" android:layout_width="fill_parent" android:layout_height="10px" android:paddingTop="0px" android:paddingLeft="0px" android:paddingBottom="0px" android:paddingRight="0px"> <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:columnWidth="90dp" android:numColumns="auto_fit" android:verticalSpacing="10dp" android:horizontalSpacing="10dp" android:stretchMode="columnWidth" android:gravity="center" /> </com.unimelb.pt3.ui.TransparentPanel> </LinearLayout>

    Read the article

  • Gridview header issue: call event on header

    - by Joris
    Now I got this gridview, And I need the headers to be clickable, whereafter an event starts (something like OnClickHeader="header_ClickEvent"?) Ofcourse there is a SortExpression element, which enables to sort the grid, but I want to be able to start any event, like when clicking a button. I could not find any solution within the asp:BoundField nor asp:TemplateField... I thought a hyperlink could solve the problem, but that was a bit premature. Also, when using a TemplateField, I find it very hard to fill the column with data. Could anyone bring me the solution? The Gridview: <asp:GridView CssClass="gridview" ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Student_key" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PagerSettings-Visible="false" PageSize="14"> <HeaderStyle CssClass="headerstyle" /> <RowStyle CssClass="rowstyle"/> <AlternatingRowStyle CssClass="altrowstyle" /> <Columns> <asp:BoundField DataField="Studentnumber" HeaderText="Studentnummer" > <HeaderStyle CssClass="header100" /> </asp:BoundField> <asp:BoundField DataField="Prefix" HeaderText="Voorletters" > <HeaderStyle CssClass="header75" /> </asp:BoundField> <asp:BoundField DataField="prename" HeaderText="Voornaam" SortExpression="Voornaam"> <HeaderStyle CssClass="header75" /> </asp:BoundField> <asp:BoundField DataField="nickname" HeaderText="Roepnaam" > <HeaderStyle CssClass="header100" /> </asp:BoundField> <asp:BoundField DataField="insertion" HeaderText="Tussenvoegsel" > <HeaderStyle CssClass="header100" /> </asp:BoundField> <asp:BoundField DataField="surname" HeaderText="Achternaam"> <HeaderStyle CssClass="header100" /> </asp:BoundField> <asp:CommandField SelectText="show results" ShowSelectButton="True" > <HeaderStyle CssClass="header100" /> </asp:CommandField> </Columns> <EmptyDataTemplate >There are no results shown, please try again.</EmptyDataTemplate> </asp:GridView>

    Read the article

  • How to populate GridView if Internet not available but images already cached to SD Card

    - by Sophie
    Hello I am writing an Application in which i am parsing JSON Images and then caching into SD Card. What I want to do ? I want to load images into GridView from JSON (by caching images into SD Card), and wanna populate GridView (no matter Internet available or not) once images already downloaded into SD Card. What I am getting ? I am able to cache images into SD Card, also to populate GridView, but not able to show images into GridView (if Internet not available) but images cached into SD Card @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { myGridView = inflater.inflate(R.layout.fragment_church_grid, container, false); if (isNetworkAvailable()) { new DownloadJSON().execute(); } else { Toast.makeText(getActivity(), "Internet not available !", Toast.LENGTH_LONG).show(); } return myGridView ; } private boolean isNetworkAvailable() { ConnectivityManager cm = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = cm.getActiveNetworkInfo(); return (info != null); } // DownloadJSON AsyncTask private class DownloadJSON extends AsyncTask<Void, Void, Void> { @Override protected void onPreExecute() { super.onPreExecute(); // Create a progressdialog mProgressDialog = new ProgressDialog(getActivity()); // Set progressdialog title mProgressDialog.setTitle("Church Application"); // Set progressdialog message mProgressDialog.setMessage("Loading Images..."); mProgressDialog.setIndeterminate(false); // Show progressdialog mProgressDialog.show(); } @Override protected Void doInBackground(Void... params) { // Create an array arraylist = new ArrayList<HashMap<String, String>>(); // Retrieve JSON Objects from the given URL address jsonobject = JSONfunctions .getJSONfromURL("http://snapoodle.com/APIS/android/feed.php"); try { // Locate the array name in JSON jsonarray = jsonobject.getJSONArray("print"); for (int i = 0; i < jsonarray.length(); i++) { HashMap<String, String> map = new HashMap<String, String>(); jsonobject = jsonarray.getJSONObject(i); // Retrive JSON Objects map.put("saved_location", jsonobject.getString("saved_location")); // Set the JSON Objects into the array arraylist.add(map); } } catch (JSONException e) { Log.e("Error", e.getMessage()); e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void args) { // Locate the listview in listview_main.xml listview = (GridView) shriRamView.findViewById(R.id.listview); // Pass the results into ListViewAdapter.java adapter = new ChurchImagesAdapter(getActivity(), arraylist); // Set the adapter to the ListView listview.setAdapter(adapter); // Close the progressdialog mProgressDialog.dismiss(); } } }

    Read the article

  • Android beginner: Touch events in android gridview

    - by jja
    I am using the following code to do things with gridview(slightly modified from http://developer.android.com/resources/tutorials/views/hello-gridview.html). I want to replace the onClicklistener and the onClick() method with their "touch" equivalents i.e. touchlistener and onTouch() so that when i touch an element in the gridview the image of the element changes and a double touch on the same element takes it back to the orginal state. How do I do this? I can't get my code to do this. The clicklistener works to some extent but the touch isn't. Please help. public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { mContext = c; } public int getCount() { return mThumbIds.length; } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } // create a new ImageView for each item referenced by the Adapter public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { // if it's not recycled, initialize some attributes imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(8, 8, 8, 8); imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(position==0) { //do this } else { //do this } } }); } else { imageView = (ImageView) convertView; } imageView.setImageResource(mThumbIds[position]); return imageView; } // references to our images private Integer[] mThumbIds = { R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7, R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7, R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7 }; }

    Read the article

  • Binding an ASP.NET GridView Control to a string array

    - by Michael Kniskern
    I am trying to bind an ASP.NET GridView control to an string array and I get the following item: A field or property with the name 'Item' was not found on the selected data source. What is correct value I should use for DataField property of the asp:BoundField column in my GridView control. Here is my source code: ASPX page <asp:GridView ID="MyGridView" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField DataField="Item" /> <asp:CommandField ButtonType="Link" ShowSelectButton="true" SelectText="Click Me!" /> </Columns> </asp:GridView> Code Behind: string[] MyArray = new string[1]; MyArray[0] = "My Value"; MyGridView.DataSource = MyArray; MyGridView.DataBind(); UPDATE I need to have the AutoGenerateColumns attribute set to false because I need to generate additional asp:CommandField columns. I have updated my code sample to reflect this scenarion

    Read the article

  • gridview commandargument on buttonfield pagination used

    - by ClareBear
    Hello all, I am using c#.net I have a gridview which needs to contain a 'Use' button (appointmentId set as the commandargument). Source Code <asp:GridView ID="resultsReturned" runat="server" AllowPaging="True" AutoGenerateColumns="False" EnableSortingAndPagingCallbacks="True" OnPageIndexChanged="resultsReturned_PageIndexChanged" onrowcommand="resultsReturned_RowCommand"> <Columns> <asp:BoundField DataField="UserAppointmentId" HeaderText="App ID" /> <asp:BoundField DataField="UserBookingName" HeaderText="Booking Name" /> <asp:TemplateField> <ItemTemplate> <asp:Button runat="server" ID="UseButton" Text="Use" CommandName="Use" CommandArgument="UserAppointmentId" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> Code-Behind protected void resultsReturned_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Use") { correctAppointmentID.Value = (e.CommandArgument.ToString()); } } This is used for the pagination: private void BindAppointments() { var results = appointmentRepos.GetBookingIdBySearchCriteria(catgoryid, resultsReturned.PageIndex * resultsReturned.PageSize, -1); resultsReturned.DataSource = results; resultsReturned.DataBind(); } I am binding the appointments to the gridview within the PageLoad/search_Click This is the error I am receiving: Callbacks are not supported on TemplateField because some controls cannot update properly in a callback. Turn callbacks off on 'resultsReturned'. Thanks in advance for any help Clare

    Read the article

  • Android - overlay small check icon over specific image in gridview or change border

    - by oscar
    I've just asked a question about an hour ago, while waiting for replies, I've thought maybe I can achieve what I want differently. I was thinking of changing the image but it would be better if I could perhaps overlay something over the top of complete levels in the gridview i.e a small tick icon At the moment, when a level has been completed I am storing that with sharedpreferences So I have a gridView layout to display images that represent levels. Let's just say for this example I have 20 levels. When one level is complete is it possible to overlay the tick icon or somehow highlight the level image. Maybe change the border of the image?? Here are the image arrays I use int[] imageIDs = { R.drawable.one, R.drawable.two, R.drawable.three, R.drawable.four, R.drawable.five, R.drawable.six etc....... and then I have my code to set the images in gridView. Obviously there is more code in between. public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { imageView = new ImageView(context); imageView.setLayoutParams(new GridView.LayoutParams(140, 140)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(5, 5, 5, 5); } else { imageView = (ImageView) convertView; } imageView.setImageResource(imageIDs[position]); return imageView; would it be possible to do any of the above, even the border method would be fine. Thanks for any help

    Read the article

  • Gridview looses ItemTemplate after columns are removed

    - by Middletone
    I'm trying to bind a datatable to a gridview where I've removed some of the autogenerated columns in the code behind. I've got two template columns and it seems that when I alter the gridview in code behind and remove the non-templated columns that the templates loose the controls that are in them. Using the following as a sample, "Header A" will continue to be visible but "Header B" will dissapear after removing any columsn that are located at index 2 and above. I'm creating columns in my codebehind for the grid as a part of a reporting tool. If I don't remove the columns then there doesn't seem to be an issue. <asp:GridView ID="DataGrid1" runat="server" AutoGenerateColumns="false" AllowPaging="True" PageSize="10" GridLines="Horizontal"> <Columns> <asp:TemplateField HeaderText="Header A" > <ItemTemplate > Text A </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Header B </HeaderTemplate> <ItemTemplate> Text B </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> For i = 2 To DataGrid1.Columns.Count - 1 DataGrid1.Columns.RemoveAt(2) Next EDIT So from what I've read this seems to be a problem that occurs when the grid is altered. Does anyone know of a good workaround to re-initialize the template columns or set them up again so that when the non-template columns are removed that hte templates don't get removed as well?

    Read the article

  • itearation through gridview

    - by user1405508
    I want to get cell value from gridview,but empty string is returned .I am implemented code in selectedindexchanged event of radiobuttonlist .I iterate through gridview and access cell by code .but problem is stll remaining.I used three itemtemplate ,each has one elemnt so that each element get its own coulmn .aspx <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="false" > <Columns> <asp:Label ID="Label2" runat="server" Text='<%# Eval("qno") %>'> </asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Eval("description") %>'> </ItemTemplate> </asp:TemplateField> <asp:RadioButtonList ID="RadioButtonList1" RepeatDirection="Horizontal" runat="server" OnSelectedIndexChanged="changed" AutoPostBack="true" > <asp:ListItem Value="agree" Selected="True" > </asp:ListItem> <asp:ListItem Value="disagree"> </asp:ListItem> <asp:ListItem Value="strongagree"> </asp:ListItem> <asp:ListItem Value="strondisagree"> </asp:ListItem> </asp:RadioButtonList> </Columns> </asp:GridView> <asp:Label ID="Labe11" runat="server" ></asp:Label> Code behind: public void changed(object sender, EventArgs e) { for(int i=0;i<GridView2.Rows.Count;i++) { string labtext; RadioButtonList list = GridView2.Rows[i].Cells[2].FindControl("RadioButtonList1") as RadioButtonList; labtext= GridView2.Rows[i].Cells[0].Text; Label1.Text = labtext; } }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >