GridView auto fit images

Experiment with the GridView attributes, specifically android:numColumns=”auto_fit” and android:stretchMode. The following works for me: <GridView android:id=”@+id/myGrid” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:padding=”10dp” android:verticalSpacing=”10dp” android:horizontalSpacing=”10dp” android:numColumns=”auto_fit” android:columnWidth=”60dp” android:stretchMode=”columnWidth” android:gravity=”center” />

Passing multiple argument through CommandArgument of Button in Asp.net

You can pass semicolon separated values as command argument and then split the string and use it. <asp:TemplateField ShowHeader=”false”> <ItemTemplate> <asp:LinkButton ID=”lnkCustomize” Text=”Customize” CommandName=”Customize” CommandArgument=”<%#Eval(“IdTemplate”) + “;” +Eval(“EntityId”)%>” runat=”server”> </asp:LinkButton> </ItemTemplate> </asp:TemplateField> at server side protected void gridview_RowCommand(object sender, GridViewCommandEventArgs e) { string[] arg = new string[2]; arg = e.CommandArgument.ToString().Split(‘;’); Session[“IdTemplate”] = arg[0]; Session[“IdEntity”] = … Read more

Grid layout with CollectionView in Swift

Create the UICollectionViewController like this in a file that sub-classes from UICollectionViewController: convenience override init() { var layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout() layout.itemSize = CGSizeMake(<width>, <height>) // Setting the space between cells layout.minimumInteritemSpacing = <Space between columns> layout.minimumLineSpacing = <Space between rows> return (self.init(collectionViewLayout: layout)) } In the viewDidLoad you an set the background color like … Read more

GridView bound with Properties of nested class

Only immediate properties of an instance can be displayed in a BoundField column. One must instead use DataBinder.Eval in an itemtemplate to access the nested property instead of assigning it to a boundfield. Example: <asp:TemplateField> <itemtemplate> <p><%#DataBinder.Eval(Container.DataItem, “NestedClass.Name”)%></p> </itemtemplate> </asp:TemplateField> Alternatively, you can create a custom class which inherits BoundField and overrides GetValue to use … Read more

How to hide columns in an ASP.NET GridView with auto-generated columns?

Try putting the e.Row.Cells[0].Visible = false; inside the RowCreated event of your grid. protected void bla_RowCreated(object sender, GridViewRowEventArgs e) { e.Row.Cells[0].Visible = false; // hides the first column } This way it auto-hides the whole column. You don’t have access to the generated columns through grid.Columns[i] in your gridview’s DataBound event.

android gridview row dividers / separators

If you are using custom layout for grid items. Below code will work. Step 1: Give background color to GridView This is going to serve as a divider. Give horizontalSpacing and verticalSpacing as 1dp backgroundColor will be your divider color. <GridView android:id=”@+id/gridView1″ android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”#e5e5e5″ android:horizontalSpacing=”1dp” android:numColumns=”auto_fit” android:stretchMode=”columnWidth” android:verticalSpacing=”1dp” > Step 2: Give background color … Read more

How to set different columns for rows in android gridview

I have something similar and i solved with the new RecyclerView. I created a Fragment with an a RecyclerView. RecyclerView on xml: <android.support.v7.widget.RecyclerView xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:id=”@+id/filter_subtypes” android:layout_width=”match_parent” android:layout_height=”match_parent” /> On your Fragment/Activity (OnViewCreated in my fragment case). I find the RecyclerView and set an Adapter- a normal Adapter class inherit from RecyclerView.Adapter< YOUR VIEW HOLDER … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)